Message ID | 20240326021656.202649-2-rick.p.edgecombe@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 5AFFFC54E64 for <linux-mm@archiver.kernel.org>; Tue, 26 Mar 2024 02:17:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5153C6B007B; Mon, 25 Mar 2024 22:17:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C59B6B0082; Mon, 25 Mar 2024 22:17:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38D0B6B0083; Mon, 25 Mar 2024 22:17:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2471B6B007B for <linux-mm@kvack.org>; Mon, 25 Mar 2024 22:17:19 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9CF58A0587 for <linux-mm@kvack.org>; Tue, 26 Mar 2024 02:17:18 +0000 (UTC) X-FDA: 81937578156.04.DFBCD63 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by imf11.hostedemail.com (Postfix) with ESMTP id 2F3D140004 for <linux-mm@kvack.org>; Tue, 26 Mar 2024 02:17:15 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Lzw0SOWH; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf11.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 198.175.65.16 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711419437; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eJm8lpz0TdCXTRj/Mr4Q33H6qQGbh1S3uqIwNQXlM5o=; b=MIC+hLSdPxd3fJgpAUkK0wS/LoQJR0mkJqou+kvnkPTI06mFL93TyChqqyySAj84W4WCBf +jVI7YjJ40hiXrobKb6MHd8nlwOcRxHTZNul6xS2xhi0ZixLMGvYMypdC2P9oWPRfbnHtA LVpxLyanOVpgy7dh7A+GYd7pHokRn1o= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Lzw0SOWH; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf11.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 198.175.65.16 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711419437; a=rsa-sha256; cv=none; b=XDhiIlcXgUKOhPHL3ctSQBX9dEWS+QtaaIf67+cBryoBqXRBVO4TC2SCSff6ZcIWoGXMGT 0nY2196MLxuQEuUZDnKrKtSsSEepgQU2NC+M5+UmBQNZC8kTTACza1QdAIO6qogCOijZLj O7c+llmJaQ5ZoXALx+Ek4aIhoV4fGz4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711419436; x=1742955436; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=C3HKCFW/8Pu4EQqUdufuRIZx47fZhhZskIiwq7U/w8E=; b=Lzw0SOWHPNiaX558/E/Fv/meWpEiMiI4vWXV1oPMJi7s7+J1HrkdG084 jm5UUmaYHhhCt/P9E2PIlLGzeADwYC8snAlSnM05IgaDHTroinMlyfoUz IGj0g/GUDEbWw0N+K5b3BG/S2seaCDPuDZwfaPpYH6XxAB0nPoJU6XI6f Ui8/kBvOBNqK9e+s2i7oEMXEmpE3ARAIawl5kSLQK3F/GiVj6C7YjbdmX b6L8YC7eSYZRjzp2jFNyb9vvEEFOdydKz9ITwVmCGkR0ZlFdhLp1gp4Kr fY94pivLXghVS8HLOiGLzWlWnezpAgQ/mnmSOgtOnQFn0HNT1QuTlJn3K w==; X-IronPort-AV: E=McAfee;i="6600,9927,11024"; a="6564208" X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="6564208" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2024 19:17:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,154,1708416000"; d="scan'208";a="20489864" Received: from rpwilson-mobl.amr.corp.intel.com (HELO rpedgeco-desk4.intel.com) ([10.251.11.187]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2024 19:17:14 -0700 From: Rick Edgecombe <rick.p.edgecombe@intel.com> To: Liam.Howlett@oracle.com, akpm@linux-foundation.org, bp@alien8.de, broonie@kernel.org, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, debug@rivosinc.com, hpa@zytor.com, keescook@chromium.org, kirill.shutemov@linux.intel.com, luto@kernel.org, mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, x86@kernel.org Cc: rick.p.edgecombe@intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v4 01/14] proc: Refactor pde_get_unmapped_area as prep Date: Mon, 25 Mar 2024 19:16:43 -0700 Message-Id: <20240326021656.202649-2-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240326021656.202649-1-rick.p.edgecombe@intel.com> References: <20240326021656.202649-1-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F3D140004 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 5313rk84375bwjgayqpx98hoxhgxpapk X-HE-Tag: 1711419435-250761 X-HE-Meta: U2FsdGVkX18KYzZyHB4F8oEnjCXzE1wrg0WA5I5aWd7E09CQTJErdBKanFnOs5nlWMmNL1dwYsvFYFOBJx3rc31BQrUkzMqT5QyUdjedpCluU9EjiaSV2nR4Mlk4CfGbqgDmuaagdSzOanvEghc0v/d2YKpcE/oR66wrw2LdVCOyX5WmrqjpwlV0DK1egc3V5wg/CvCRowwZ4OT2JMYZD57ywQ7NWSjLHeA0lJh9QB+2ZR6iIQGKsw3O1MXLtdOvptQyL2y60s61dav1kHnoK2Bw5OTBCuzRIXD9jBOX+gBPhU97F20zgpy3EGJKO2doFM4ZLEaFYeKQ1aVruzYGAmynRh6ZcK5yv55kMieuWIl8jSdIVyDLSdmm4TAbkf2Z7fqiTH2IpbPrUQqWuzoJ6IbxIM6JPxdO8ojRtpr0dmtpBwa9V34/lJVpMsiZG+moSGzKXCeIYjRt82FUN5ZKOq7c+i4EQHPtD8SmN9u6/ysWVDdH2FABl1DWioc59CXpA0evevSRRO4ONOTUXdMK4dJX/xr+uYvXQ2dI5Qa5YGb34LUAbmzvtRtvtBpcCyrifSbFb0u+0lHeiFg8ugYOQFOw+mZaUTxhfYNbiU8oXAwHCpAtb6mxDaBc47GEVKKnzHonVbYftTXN05ElrA4pL+scwt+p1lXLyDCfrqmEDgzU6AiATXY4TOHicB3ngnhh8xopJZQFxB+c5+qV2uUNeFSIjjnzY6qfSzATcfRMamiJGDEzciSPxZTkazq8pa9fMGDJpZ9xxwuczJgMbDUkNrG1kUZo/iZy0r8C5xB5M70R1IXfqrWtOO87I8dC5MuYs6Nh67CTj6Ju5uSUwSHneRjijPAWN59MN4gqBNaIPegnVv1x/IiJRPgBJgmP1Xlo1pLUV0fty5wBbULYXSYB2ekhNzIk1TGp3iUZzchbBZoU4cjoF/f4fw== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Cover a guard gap corner case
|
expand
|
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index dcd513dccf55..75396a24fd8c 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -451,15 +451,12 @@ pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned lo unsigned long len, unsigned long pgoff, unsigned long flags) { - typeof_member(struct proc_ops, proc_get_unmapped_area) get_area; + if (pde->proc_ops->proc_get_unmapped_area) + return pde->proc_ops->proc_get_unmapped_area(file, orig_addr, len, pgoff, flags); - get_area = pde->proc_ops->proc_get_unmapped_area; #ifdef CONFIG_MMU - if (!get_area) - get_area = current->mm->get_unmapped_area; + return current->mm->get_unmapped_area(file, orig_addr, len, pgoff, flags); #endif - if (get_area) - return get_area(file, orig_addr, len, pgoff, flags); return orig_addr; }
Future changes will perform a treewide change to remove the indirect branch that is involved in calling mm->get_unmapped_area(). After doing this, the function will no longer be able to be handled as a function pointer. To make the treewide change diff cleaner and easier to review, refactor pde_get_unmapped_area() such that mm->get_unmapped_area() is called without being stored in a local function pointer. With this in refactoring, follow on changes will be able to simply replace the call site with a future function that calls it directly. Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com> --- v4: - New patch split from "mm: Switch mm->get_unmapped_area() to a flag" (Christophe Leroy) --- fs/proc/inode.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)