Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3493785pxb; Mon, 24 Jan 2022 10:42:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhdEOWVQZcsMGxqI0Y78hIU7mFMdunLBT8puLzWOhKTNygLd7k1KZKCEJdnnkedUd8YivP X-Received: by 2002:a05:6a00:1945:b0:4c3:39cc:52c6 with SMTP id s5-20020a056a00194500b004c339cc52c6mr14817898pfk.18.1643049770824; Mon, 24 Jan 2022 10:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643049770; cv=none; d=google.com; s=arc-20160816; b=f+NdKC1XhvI1iP6FSwvUcTFhv6XOn0IK7CvfggveA8fw87jsMsGlsaRi44o0mR0tg9 RSaWWjCieHk1YnTQYBYy/HmAwHL3d9fKY7161v9AlZGRFglIKbykHvoy6v694Op0z/SF HgzCiJLzbFY/f5cMGYmRZ0LAkMyObkw+puo9Uo3Dzb2G3odJWi2TAr+U8h85rHg5XIHf YdXpQa0P9tb+0iFyqobPObY1i3cklAZvSNjpSiZQd/vkKDntzKm0PdvPSNoTYPb/QaUa Zc1mTlHDpo8F/SeiN9neHPgaRwCyzHj8S5r3V8oZZoaC1QvSVuqAYt+9WO9kaJyIyyLs e4gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wm9QWOWAoKnKE8jbHgQf6O6XgO5ODHRTGPygTipLI00=; b=ItfAvAJ3YclavKp9d1kfHgWZEuNijmy9uhrGPFBoeC8Gigg/rmqQ/OmQ4lJnfY/3yC 6x28BEOaMBebQG/odjnDWprf8LcHkbbf/E+AC6Dj8EDTEN2RUCg7dl09YKFK6KeULZNJ 5aYWXq6x2GqKO3p5354OgdhE3MsuVu2n8ptafNM6ovNEICEkFVKS2ZK2B4lt2GouESuB dfTP2PrZWEP3GNuT1Tr3ZRGXEHuQdnGwM/eErGpSfNHelvOGB32LDVcSmBYC/xl6DEz0 z6REORmnqqlLeG0V/4aHpMQXIifwSCME77E9U8Ns8b47iQhpvJSxyOdOqDqRIPi2fFg5 bpBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ZhSOw6y0; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si92538pjf.126.2022.01.24.10.42.37; Mon, 24 Jan 2022 10:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=ZhSOw6y0; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241843AbiAXHbV (ORCPT + 99 others); Mon, 24 Jan 2022 02:31:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbiAXHbS (ORCPT ); Mon, 24 Jan 2022 02:31:18 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C614C06173B; Sun, 23 Jan 2022 23:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=wm9QWOWAoKnKE8jbHgQf6O6XgO5ODHRTGPygTipLI00=; b=ZhSOw6y0O+aXYSf2WxdcCVJjgg +ZN8avm2joj0S5DBp8UHCsG/XhcTwW86PbqDoGOj9MDtZ5b9GlDCnjYLHGbEfmOT2Qs+yrtb47ihy N1pmUz4y0aSlHckLeL2GtCuEdYduiKRlfsyB9sCAf5mMRxZkjFEYh6GZwlqD3o5xPS1q8hJOsFdsY kComh8k4+fsuflvjI+t0qG6EZuujnrUKInbRApEPjSiqrosquB3RYdhbl0/QMbWmG+luKBpQCYuyp 6rcDu0RPp8q5dew29Bes1s0C3RbpuncnXVAFbtG4QJ5N84jhRvxI/1k2N8q4lrn4492kH8ISZej2B sCSHorCA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBton-002UYH-Sm; Mon, 24 Jan 2022 07:31:13 +0000 Date: Sun, 23 Jan 2022 23:31:13 -0800 From: Christoph Hellwig To: NeilBrown Cc: Trond Myklebust , Anna Schumaker , Chuck Lever , Andrew Morton , Mel Gorman , Christoph Hellwig , David Howells , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/23] MM: reclaim mustn't enter FS for SWP_FS_OPS swap-space Message-ID: References: <164299573337.26253.7538614611220034049.stgit@noble.brown> <164299611276.26253.11555458501911153645.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <164299611276.26253.11555458501911153645.stgit@noble.brown> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jan 24, 2022 at 02:48:32PM +1100, NeilBrown wrote: > If swap-out is using filesystem operations (SWP_FS_OPS), then it is not > safe to enter the FS for reclaim. > So only down-grade the requirement for swap pages to __GFP_IO after > checking that SWP_FS_OPS are not being used. > > This makes the calculation of "may_enter_fs" slightly more complex, so > move it into a separate function. with that done, there is little value > in maintaining the bool variable any more. So replace the > may_enter_fs variable with a may_enter_fs() function. This removes any > risk for the variable becoming out-of-date. Looks good, Reviewed-by: Christoph Hellwig