From patchwork Fri Jan 6 21:52:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13091834 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 BE70AC54EBD for ; Fri, 6 Jan 2023 21:55:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 159478E0002; Fri, 6 Jan 2023 16:55:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 109828E0001; Fri, 6 Jan 2023 16:55:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EECA18E0002; Fri, 6 Jan 2023 16:55:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DE8EC8E0001 for ; Fri, 6 Jan 2023 16:55:10 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id AE5CF40F0F for ; Fri, 6 Jan 2023 21:55:10 +0000 (UTC) X-FDA: 80325730380.23.0AB0BDD Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf15.hostedemail.com (Postfix) with ESMTP id 62636A0014 for ; Fri, 6 Jan 2023 21:55:07 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="hL/P8yub"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zIY479ob; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673042107; a=rsa-sha256; cv=pass; b=k2fzrnlAo0rLgSRoNcKm+MnIKIP15YnpEV9yxLtdMuIIYJXH8cgrqg8YM32Q/utgQatPW0 d4BKlDPx+PPBcu83+xFUOfJNkPBsvxIlBYygjxZIBAzOtflPHk6iRKkRDEv9lU3x6TAold 9nPpJfiUZxHMX5HyBesVoXccCYRwvD4= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="hL/P8yub"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zIY479ob; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673042107; 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:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=RpFFYzyO80UMpUfGKtMWiJz2MeJ8Z1Oy9LNDUb4rOQk=; b=iWQWbXR11D/hIRT5jP4MSUGMrU52UAugVv6PHAwbwlDu9wUx5+jbabxj7BS00BQ9XhMOVd e11QMe31DxPTX0wlerbbtQo7Im4PdkNYOaLexgXfz3H6mVR4DtcfG2dkpOrCsV7Al5chtM 0J+LpDNSx2mdLUcMYiRPaqY5EgXNi8Y= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 306KotAP025482; Fri, 6 Jan 2023 21:54:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=RpFFYzyO80UMpUfGKtMWiJz2MeJ8Z1Oy9LNDUb4rOQk=; b=hL/P8yubvYNPiHEzs4G5c+64A+HgQMUEkBcBLNVqHKKuW1ub0NGKFM6x0t+9Ufg0bddk 8ZDWDzJicw7Rpe1tywrsGpKi3ZQiLeI60WZHXc18HKalA+3FNMUekFjDGXIyjAP94Um7 8l1g65n625VmGNapRw8Y7GGu6x0yCsftX2Lu/WvWnb4kwHbhOF8bvhG/Y4U03hw7VtI2 N9pr0oKIaYuBP63rHzRsGd6TvwSz5OMlWwU99Hv2hQbNNdacVyE01ZJAVCjMEn3Ujbf1 CswAloakwZPYKLCxRdI8Si/ANBeAu2S4cQfGsQFQ4HPobe1WEan6OdLcruRTJe3a4kqc Eg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mtbp146dk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Jan 2023 21:54:50 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 306K3sO8023314; Fri, 6 Jan 2023 21:54:49 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2172.outbound.protection.outlook.com [104.47.73.172]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mwxkgq3pv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 06 Jan 2023 21:54:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OIZVxGXUXKtSXsPItrDIi1csxKgQiUyK5YoQ1FSCIUjYeJbJAgOAY0NGi1t6T8O1s1i/b+7Twuue8mq2vqHhlWsLzf9R9w8qSS8jqXvQL7jSNgYk/auByjuYB9ehZzg2fwb0fOTnf8sM3DhW+bYEWGPS3cUmraK/OF5/zjx046M+nCBOhpWZbSdq3z/leaWohFCUGQP8XhHf5PRXcqitV8jB7PAf7GdXY+dpfAGOEdvhacZpbQiIrM0uyPqshg0zKrZclOPG/OBGDixZDyut3i6XOjybjHmlEuJ9942lZLiaPJDYx9TL/oLUKwd4tJL4VOYUU4Xk9rp22jHOeAfZWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RpFFYzyO80UMpUfGKtMWiJz2MeJ8Z1Oy9LNDUb4rOQk=; b=ATnZAd/zgmiEclOAhus8za7o/56WSHqXCPZiu8ck8qbJo3ucZWB6luGxyhqifypCsjd1wObbDDs1dTWH4C1tgT8QOaNvQ3tkClEdUMm/0HrJ6v0sTG8nTaQYBwmPiXmHLkIgeQb+2xfh66Np2C3r27pSmrJ0EJ0MD6hOBYAlxwlQHPih6BptpH2dBel/Rvppry/sOVfcHHcftaJZn8DqyTAjtyxmtdeytmlafd9G7QzgQFXjoaCSzVuqm6ssyYXczVr7h3w+siDxOjdIM7ZOgv2SiftRo66V5Q9kc2XAEwxTTvY8OOxcBYyw5JR84IO/7Vh+JgaivDGq7ry/wv75cA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RpFFYzyO80UMpUfGKtMWiJz2MeJ8Z1Oy9LNDUb4rOQk=; b=zIY479obFwMrFlXChzdCfNHPkiCITPZEawBNkKrBSbgGn1NBfRrWfOLTDG+SXAQYE/nUPOKWNt36X2zsi3yb8ILJ7hUDrC5ig1gj4t71JbRUXiurl6xWnUc6yVtk68GI65dCiHd+gJHOWnUYlMDqZb0OoLFHx9ph+yRbP4d6UpI= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS0PR10MB6774.namprd10.prod.outlook.com (2603:10b6:8:13c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Fri, 6 Jan 2023 21:54:42 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f%9]) with mapi id 15.20.5944.019; Fri, 6 Jan 2023 21:54:42 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, vbabka@suse.cz, sj@kernel.org, Sidhartha Kumar , Matthew Wilcox Subject: [PATCH mm-unstable] mm: introduce folio_is_pfmemalloc Date: Fri, 6 Jan 2023 15:52:51 -0600 Message-Id: <20230106215251.599222-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: BL0PR03CA0016.namprd03.prod.outlook.com (2603:10b6:208:2d::29) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DS0PR10MB6774:EE_ X-MS-Office365-Filtering-Correlation-Id: 80de60e2-7a7e-4eea-fcb3-08daf0309dbc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ulaq1uYTcVXAOasFh9rCUU7jE59Djna7lY0EwNgabMDwgyVQ1prhKDcEiaynX9pCO1pMWDj7wtkmHM3iYlrCt0I0xeZ6DT9Wa1G9SNBuVUEKPCX/WvmqbG3Du5RHaZZkXaVzxfOEcUlryDncBOz5O6sYK+TA7uGuOVk0DEDMM7qWyvax+T3DWfhnYCxkIJZ5zwbk5eXEN0BRN5uI+1LZIylPDjhR716NyS9LgPzHtD8aX1q2Zdu1s7BYGiGAc81d0bKbzCQJYiUpcZKBRI0YNWIGgV3ls+w/fnyZq6+OXgAhmRh1lP741jdQ5jgZOwuHJNTZ2fDmAKMGOvRlaq2O/1lgx/TFiIZhDQHQxe9c3Xb0vs64e2ldxpzsuNHNvI+5v1KGSGmNXgX0Xvcb1GPGwNYjTG/f5PweIETNr7ZoKg/zwGaL0l4MyK7QAXMygSnATcgEq0QKBrBxVtktK/8WdzsYIUNEELthOId+2fHWYQBRk7bKyrZ8vzNmdOTtaaVPf1O/UK2kzmUrd/pLCUWawV3vsC1q1KR8DAHIxgSdjsil+fmdtcIJPnLwCKpXI3QvGiCSP68TOcaHxNO9zRFQz28VLV22gTa0NGIyRFcqQ7UjrfH99UzuckBrWGbSCYQd/cK8D/l1rTM36JLor1/RAQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(376002)(136003)(396003)(39860400002)(366004)(451199015)(36756003)(5660300002)(41300700001)(38100700002)(44832011)(8936002)(83380400001)(86362001)(66946007)(6486002)(54906003)(66556008)(2906002)(478600001)(6666004)(8676002)(1076003)(66476007)(186003)(6512007)(2616005)(6506007)(4326008)(316002);DIR:OUT;SFP:1101; X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YLal4nzyPRm+eZp3D5n9hzp3MlE+6X1w68WOV/pquP/Olf5Hc1cSS1/uKx6CIbdpmpao4mY7eYkqNU+rOVrnc2ScVZ8DGk4Z6b47YJFXZxcdpdVm6UJbQqucDflu6eVpO3pmTPOekrEXMFcsFeUGA9RfXWNVJAcegnaE45aPJ7gDpp3rpLUDjXVuTnoT2bqHoSoKwruIGytI41RmVA2HdfYhrsHGE9IiXwc9XJqF0BaKu+LkaCBdKnrV9Rk46/eoHae43X1h7JoRKTKU/YM93W0XmSrNBCtw0VHojFMoQ9nf4M2nwf1ZcK/JQTGhis53nebzDYMbExqaT5cqRz15GIGPcBA+hzYPNHlp6d2+MDiqjK+IVxoIzlkZDrzfch7mWHDeSb0Fm7R+uC7vfTLt+bXH4krlU39F3xY52ifgY2IP2xTD/0YKh2+/20a6vK1EbEiBl0AqemUn860v8yBLedApl2sBZ6mYULucoNglB0yUxy0ZRvHnD0Y/e5XY9Jovj7OAwn7yolx9x04uYjjqeRRugCHdtlFLnjp4jc8i+s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80de60e2-7a7e-4eea-fcb3-08daf0309dbc X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 21:54:42.6069 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lyTUUpsUNEAGxwPG7Dpd96LKgd58GX8uF0/g7XZ8lyCgrIAPvs6Oa8Nh191vTabEJxXvtqTP+shmYjhcdNcIMEQZzJg2D75xThzEsiNHe4o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6774 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-06_14,2023-01-06_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301060170 X-Proofpoint-GUID: 7zcQ9muLaGLmFqbrE0Y4uC3TjfDZRPDu X-Proofpoint-ORIG-GUID: 7zcQ9muLaGLmFqbrE0Y4uC3TjfDZRPDu X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 62636A0014 X-Stat-Signature: x4cj6j9jesepp5xen4ciezmpqss3kndb X-HE-Tag: 1673042107-518625 X-HE-Meta: U2FsdGVkX1/AtRjy9xCDbxa3X5QCahi2hdF1YEwMKlAdpeiEdSqDHvlSJ9ilCDGuYa4thRISZxtPt860wc3cFrz2mi1dSSyovZacP+IfwKBhACoJOylaN2/7Ej/AQr4wvvWtufAnBOGXmEo+HstBko4XJVObOhmoE920RGBEwyLgix7UisUF0ValdCZFkqnxQE8DMoAcHizlAXMp3OLK1aBKsHiTa1xvN2vmezatM5AcSJO3NvxCv2jICiPUBAOGXM/hI9hIMy4Fnfp2+ozUulqgA7cNLU4C5R0eYDl9hw0kk8mLl5ouJ89/BgrgsBtUS+iZwLA7dsIMQtM5gw551pB20MNtyxorRSB7nxDjLqRzykesvlrqXyGiGj6hyH5pSVME6ArtCl6ebpjIz5RqNJE3GgvX1j9SkdvMFig8Tc6ZKlgR3oZqtkeP49f5JPuDN8qO74OW/Arnt+hAfZh9+e7oRF0hWw94K6/UjnaDf9Qn6dY3365CNehNg5q4zZTyjT8vPCSf+ZHz/3ELfOujBaiabo6+A9yDqJqXYO+p6Jmo23WwJIpjl0W/ChLBmL0aApiTOiCJe7yhfcX/A94H9BkrxG375VN94Q5NmrVDGb5qS0THWHvV8mPIs9wMbF756oxa3IcfWxW3ruc0Kn/ZmuOkiF5UEr4J+EM1g7fdUIra4/492KfiYVWJcIuUp6gHHvugkPa+nm7U2x3aYSWdWR/Z5C9zZgypbmNCqgx66eY6AcAfvRkv0MIubICKWQScD4XYBe6p3zakXbKwqDYan98zHJpWv/ao5IUsy/yd5+Zm0l/vpjeiZAZRvM8bhLUMGp6pQ2gd1bOaR7c6Ss+ZUJTKKa2XT7KSEzGznA+1A8WZ+4DLPdmGg/Th4ANn4hVbHimO946DqH9I+y1fu3I8RhtX/KXk8OLmk0AAfbszyVY1cH5QHRClCrLShCeG8KXzE0JTBh6ANcLpKbl3tIp aobVk4PX LV56GG+jexKq2ik5aWPpDAG6ptxAR2n3nRmntXL2/G+07aE3RtSMJIY7fq/jyayw8v9qHLOZlIExR3YFCbQJvGgowxH5N8JDaptaS+jhz1X6jtJAvu3ElGpwwEc9bfV3B/v5AkMPpkfbavZd2NQ6oUCyFLw== 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: Add a folio equivalent for page_is_pfmemalloc. This removes two instances of page_is_pfmemalloc(folio_page(folio, 0)) so the folio can be used directly. Suggested-by: Matthew Wilcox Signed-off-by: Sidhartha Kumar Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: SeongJae Park Acked-by: Vlastimil Babka --- include/linux/mm.h | 15 +++++++++++++++ mm/slab.c | 2 +- mm/slub.c | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index c37f9330f14e..79d5a0cbf4c3 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1906,6 +1906,21 @@ static inline bool page_is_pfmemalloc(const struct page *page) return (uintptr_t)page->lru.next & BIT(1); } +/* + * Return true only if the folio has been allocated with + * ALLOC_NO_WATERMARKS and the low watermark was not + * met implying that the system is under some pressure. + */ +static inline bool folio_is_pfmemalloc(const struct folio *folio) +{ + /* + * lru.next has bit 1 set if the page is allocated from the + * pfmemalloc reserves. Callers may simply overwrite it if + * they do not need to preserve that information. + */ + return (uintptr_t)folio->lru.next & BIT(1); +} + /* * Only to be called by the page allocator on a freshly allocated * page. diff --git a/mm/slab.c b/mm/slab.c index 7a269db050ee..01291ecbc0d8 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1373,7 +1373,7 @@ static struct slab *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, /* Make the flag visible before any changes to folio->mapping */ smp_wmb(); /* Record if ALLOC_NO_WATERMARKS was set when allocating the slab */ - if (sk_memalloc_socks() && page_is_pfmemalloc(folio_page(folio, 0))) + if (sk_memalloc_socks() && folio_is_pfmemalloc(folio)) slab_set_pfmemalloc(slab); return slab; diff --git a/mm/slub.c b/mm/slub.c index 13459c69095a..0cbe6eff23fa 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1859,7 +1859,7 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node, __folio_set_slab(folio); /* Make the flag visible before any changes to folio->mapping */ smp_wmb(); - if (page_is_pfmemalloc(folio_page(folio, 0))) + if (folio_is_pfmemalloc(folio)) slab_set_pfmemalloc(slab); return slab;