Message ID | 20230106215251.599222-1-sidhartha.kumar@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1042940wrt; Fri, 6 Jan 2023 13:59:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXu7tY5oyTSCAU/jOFreoa9JyM5elxWxEzorRQzaywpSSxvVaS65Fq2vJwBDFvHS8GS8Nag9 X-Received: by 2002:a05:6a20:3c8f:b0:ac:5bc1:cca6 with SMTP id b15-20020a056a203c8f00b000ac5bc1cca6mr88959504pzj.8.1673042379666; Fri, 06 Jan 2023 13:59:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673042379; cv=pass; d=google.com; s=arc-20160816; b=Salxz39+6qAgOphrR2m8I3ak1PhtBmzZf7jYkmdEbc7TGLq5U1pl1pEawyByVSYS0n xQ1S1rmbHmArv2Gn0gL7Sj9d7vY0JiMOWzuzXpFrf3T1nWBDXsIIrQJkksB1xMM5Kh7b CU710qyFCQM54srwv9T8S1k4UhD4DuOVq0CdjF1Lo9Kc4xsDsDG+6F6k9inTdne7OzIu RouaL/HRtCnrwuEcICUv4ePDCMDqvJMK2oBCszY7lYVxKSVF7CqTAo3kv/vroxSmcUMX f81S/79DLHHGYwLdMX3S3EGT1+a5/ASRiMN7nVXOi+2vPBT4mLfv2FLn7JLLOYCNZA8Y Al5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=RpFFYzyO80UMpUfGKtMWiJz2MeJ8Z1Oy9LNDUb4rOQk=; b=GKmzRbK62uXTAp5wAW9waal9bcumplY2Urmfjyne7WA1k36yXMvup5ImnK3dUdBuZ7 dQ1xkVh3/NhrgzJb3tjcZNWMATy4zCIN4YAIXb64tErh7xlJHU00FG8nTYooWW6OMIf2 iHrCRydA23obsD7MQ/2SU/sHalg0HrJhLtbaeA4aZRTR8NdZi8+Oe+KLSjkUCtfteXDM BvAHtt+VvV1jisrbJg4gpoNvOYKq7Z22y2q3kXUR12vOST/ziqAQngo8vjBb5ATE1aUs vZKeL2M+dUnpAUP91htpXe5LqVAmmKfE4Xnh/RiYwlVbpMXQPWbcoeuGUgd4dKVhhdU5 /Nng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="hL/P8yub"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zIY479ob; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i189-20020a6387c6000000b00478f1cf941csi2479554pge.358.2023.01.06.13.59.26; Fri, 06 Jan 2023 13:59:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="hL/P8yub"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zIY479ob; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbjAFVzX (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Fri, 6 Jan 2023 16:55:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjAFVzP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 16:55:15 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 585D07FED4 for <linux-kernel@vger.kernel.org>; Fri, 6 Jan 2023 13:55:14 -0800 (PST) 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 <sidhartha.kumar@oracle.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, vbabka@suse.cz, sj@kernel.org, Sidhartha Kumar <sidhartha.kumar@oracle.com>, Matthew Wilcox <willy@infradead.org> 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ar044ZL56kcOA/nahvI3xZLBQMbVywqn1z3Kdey0RoxHF0XBkOV4XuoDdlarMq/zHLfRqz/bqf1Y0iugInWlBSJWYD/XJMpI3v8WEo4WQpPHWsQRi8ViwxXmyD9NRIBANIIxSiyUmY7qLOlQGX0vconJnBFAzgXwTveoskr/M8MsoI88QyeLJaHjVioj+Ypnzrh5b+USmhJZEZ6We7OAecRp2CjmpIQ4O6VF/RdcFhN0aSZ+v/SMdRbBTzqc2z2HX/G2bVcErlTRh86kPeIlFlzaaFTMH3FjIi/hs9ejJnRpmFiLTJXjNbur0c93WQZ1JjGUMfMbDInkcfZtkX7EwoMr7zAGOyDfwFbY+xRBrSkbVQDR2d/tujKpB23LkqF7izgpyzFNpsq83gV3i/8e150Vpt7IV2YgZirRLzeQiwhJshdjfGArIqvPIr6KcSdZy8OjW8T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j7OAwn7yolx9x04uYjjqeRRugCHdtlFLnjp4jc8i+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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754312086262083916?= X-GMAIL-MSGID: =?utf-8?q?1754312086262083916?= |
Series |
[mm-unstable] mm: introduce folio_is_pfmemalloc
|
|
Commit Message
Sidhartha Kumar
Jan. 6, 2023, 9:52 p.m. UTC
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 <willy@infradead.org>
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
include/linux/mm.h | 15 +++++++++++++++
mm/slab.c | 2 +-
mm/slub.c | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
Comments
On Fri, Jan 06, 2023 at 03:52:51PM -0600, Sidhartha Kumar wrote: > 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 <willy@infradead.org> > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Hi Sidhartha, On Fri, 6 Jan 2023 15:52:51 -0600 Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote: > 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 <willy@infradead.org> > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> Reviewed-by: SeongJae Park <sj@kernel.org> Thanks, SJ > --- > 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; > -- > 2.39.0 > >
On 1/6/23 22:52, Sidhartha Kumar wrote: > 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 <willy@infradead.org> > Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> Acked-by: Vlastimil Babka <vbabka@suse.cz>
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;