From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E715C78C9C for ; Sat, 14 Feb 2026 07:15:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.110 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771053361; cv=none; b=ARbmgKbFnwWCLkpjuv+DtlvhtvmMnKj7ZKRwXJIR/aY8zHzzhgDQidr9rq2BoE61bMtUARcWjAoUW6VS8E42pfzQO4FMNCBUocWluC05bQNef0Fx7yGTpI94p1jpMItHH175aRIVYlUkMeZxXY25ZAM9qJx1EPXxyeFmowt/SK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771053361; c=relaxed/simple; bh=k+h0B0NgHpo3lDz1m1uJWeHyKdAkasGKVHHKYFFD3ro=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nToV0JifPCcBB47Wh30Kw1PuSc4OCP+riVZiDArYaGqX+pSm7QTiyqFVV2n1TKqDtc/Fpohi4uL4mbQMMX5PoT+7AkU1t0O37XwD/awb2b1pPePjGftocQmEcVjZY1JqeCuJqAM+GIlFTaj3kL6b8K6qApk0c86kAky4rEqNbZE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=lHeUYFfe; arc=none smtp.client-ip=115.124.30.110 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="lHeUYFfe" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1771053352; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=NoNula111yZmPH4XcUjUgwal5v14vn6GM+WNuPDdq1k=; b=lHeUYFfeG4oCtiDBqYkVLKMsL48/2Av3ZpShmXKshp1XaaovWPPPLUtf+Lz+gsPu79OYSApJ13m54k5HP/bMFeRu0PSrSayuK6RouBFisd2l6XidLZPt6ebBD+V2jBO74Ufl3ugwRUWlpN/1X41VlnKp+0P4wCQJUIu1Dbtc5fo= Received: from 30.42.98.36(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WzAqDVv_1771053351 cluster:ay36) by smtp.aliyun-inc.com; Sat, 14 Feb 2026 15:15:52 +0800 Message-ID: <01afcbf3-6dda-41c3-88a5-560d067798e5@linux.alibaba.com> Date: Sat, 14 Feb 2026 15:15:50 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/shmem: remove unnecessary restrain unmask of swap gfp flags To: Kairui Song , linux-mm@kvack.org Cc: Andrew Morton , Hugh Dickins , linux-kernel@vger.kernel.org, Kairui Song References: <20260211-shmem-swap-gfp-v1-1-e9781099a861@tencent.com> From: Baolin Wang In-Reply-To: <20260211-shmem-swap-gfp-v1-1-e9781099a861@tencent.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/11/26 10:33 PM, Kairui Song wrote: > From: Kairui Song > > The comment makes it look like copy-paste leftovers from > shmem_replace_folio. The first try of the swap doesn't always have a > limited zone. > > So don't drop the restraint, which should make the GFP more accurate. > > Signed-off-by: Kairui Song > --- Agree. Thanks. Reviewed-by: Baolin Wang > mm/shmem.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/mm/shmem.c b/mm/shmem.c > index eaaeca8f6c39..4f34dfa95a50 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -2043,14 +2043,8 @@ static struct folio *shmem_swap_alloc_folio(struct inode *inode, > struct shmem_inode_info *info = SHMEM_I(inode); > struct folio *new, *swapcache; > int nr_pages = 1 << order; > - gfp_t alloc_gfp; > + gfp_t alloc_gfp = gfp; > > - /* > - * We have arrived here because our zones are constrained, so don't > - * limit chance of success with further cpuset and node constraints. > - */ > - gfp &= ~GFP_CONSTRAINT_MASK; > - alloc_gfp = gfp; > if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) { > if (WARN_ON_ONCE(order)) > return ERR_PTR(-EINVAL); > > --- > base-commit: ad92386d5debbde551129dc85f0118f5a521388c > change-id: 20260211-shmem-swap-gfp-c68b9d73a90f > > Best regards,