From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFE3CECAAD3 for ; Mon, 19 Sep 2022 14:34:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB146940007; Mon, 19 Sep 2022 10:34:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E5FF16B0072; Mon, 19 Sep 2022 10:34:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D2822940007; Mon, 19 Sep 2022 10:34:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C0BB46B0071 for ; Mon, 19 Sep 2022 10:34:48 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8A7FF1609C4 for ; Mon, 19 Sep 2022 14:34:48 +0000 (UTC) X-FDA: 79929081456.28.D1F215E Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id 593D340019 for ; Mon, 19 Sep 2022 14:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gMLf/rqQpWC2+XjEGcuSjEkDKbi/0GhYcmxhsgsT9kI=; b=HKy/YcOBOeh2qwxkz/0aIlfx1K HE80ZpMr8zuQCCd3t/UE0BntI4h3Mu1TeG+TL6ja45VvI33jmN9jJtZYvzCEOZgvBMqlIiax/uZ86 nN5Y/W4ip8jWmp5Jz/az5yx0PoUwTc5xyRbORDbg+FI20GDX/DbL7e+2VAw3/4gK6vMJpwKAus9To tuQ8JkjszjBlJCP9pYt7n7gssZtw7O34SwbJfd9eEZW2MeOFJaKI25dIcHjlcxcIuba5Si3O3pNCO OzeofN6ymvrV/BcVaYHgci0sQTd73g39ca1pf/UTeCMJQz19ZfTILSjvCaP9IARP2/GAy4NWyZ8/G oa6wH0Og==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaHrB-004m7e-4e; Mon, 19 Sep 2022 14:34:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 070283001F3; Mon, 19 Sep 2022 16:34:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E5B612BAC7765; Mon, 19 Sep 2022 16:34:40 +0200 (CEST) Date: Mon, 19 Sep 2022 16:34:40 +0200 From: Peter Zijlstra To: Kees Cook Cc: Josh Triplett , Eric Biederman , Alexander Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Mel Gorman Subject: Re: [PATCH] fs/exec.c: Add fast path for ENOENT on PATH search before allocating mm Message-ID: References: <5c7333ea4bec2fad1b47a8fa2db7c31e4ffc4f14.1663334978.git.josh@joshtriplett.org> <202209160727.5FC78B735@keescook> <202209161637.9EDAF6B18@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202209161637.9EDAF6B18@keescook> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663598088; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gMLf/rqQpWC2+XjEGcuSjEkDKbi/0GhYcmxhsgsT9kI=; b=8ISN1tHGYC/G5ID28HncIuPY9oYbiM2lVo59RQW5NalyE2+eJ1Zk9crp4FDEy3Ulo1ozhf W+x5wdLjI9RXicDgbFmrJ97Sqr+dxSmzgtBgf6qB/qZ4VEwLHaIhKtxvjrjYaDayjFrH/J yj2D8WKCpmy8ctQf3wPgAAn/cLRDVRA= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="HKy/YcOB"; dmarc=none; spf=none (imf07.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663598088; a=rsa-sha256; cv=none; b=3LF7vbtrqP/6O5APePeETVcZdEfB3eTxjiDv7eRaAehQGDwB+ESWJGmrxaZg33V+EHLBBo R1F3LJTrji5+r1SeIeaFH+Z2ohSzRNlkU4R220Be8cxuWipQlViFldt/8buIwBjLQWhe+A P0eglKUnihl3QpqNJ5j0QlBAcvfDS58= X-Stat-Signature: npb5wpmbor7kpnafr5ytys7atgy3ytdk X-Rspamd-Queue-Id: 593D340019 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="HKy/YcOB"; dmarc=none; spf=none (imf07.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1663598087-337734 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Sep 16, 2022 at 05:11:18PM -0700, Kees Cook wrote: > The interaction with sched_exec() should be no worse (the file is opened > before it in either case), but in reading that function, it talks about > taking the opportunity to move the process to another CPU (IIUC) since, > paraphrasing, "it is at its lowest memory/cache size." But I wonder if > there is an existing accidental pessimistic result in that the process > stack has already been allocated. I am only passingly familiar with how > tasks get moved around under NUMA -- is the scheduler going to move > this process onto a different NUMA node and now it will be forced to > have the userspace process stack on one node and the program text and > heap on another? Or is that totally lost in the noise? Probably noise; text is going to be a crap-shoot anyway due to DSOs only having a single copy in the page-cache. And the stack will be relatively small at this point and also, numa-balance can migrate those pages around if they matter. > More specifically, I was wondering if processes would benefit from having > sched_exec() moved before the mm creation? Can't hurt I think.