Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1414227ybv; Thu, 13 Feb 2020 22:56:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwakDYcEJsN1xXM5gTOoYkXfMkZ/Wh38gmfSy/LGN/r7YR8pQd+aNMPlY24s72H97HihEnH X-Received: by 2002:aca:2207:: with SMTP id b7mr912735oic.109.1581663403458; Thu, 13 Feb 2020 22:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581663403; cv=none; d=google.com; s=arc-20160816; b=iFJ8hzawpng2u313oWtY51knrcIGonVlQ24uoYqmJhxLf3aRzc2MZjS+ciFsKllchj NvkVF1muYU9XSFBVRZj2vgfAATU7aCa7/YjfLXtYODW/Ab6pWYT0rViCNuQkBE1eszWX AfDr7dIQ+0EFs12T1qen6DMRFm91H9XKmOgEACFcMhaeQMCKCp3SiU9gpGaVc60Fv3Tn BtOCn6/UvoJh43FfdreusnMXXpkCumww8s53/rM9NPqe964Yc0lmtBrovuPGhFeas5Jn J02UNro8L9o37c9uUPyPGJSKtREOzdbsvapkDh+CZ3IyACskwk0+WOFgKvchsXdYTqFQ 9qtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=eI86x/JvrHy/AVCnRwQ8huawbMtougjhcECL9y/T5ag=; b=wdzaxnzFtP+aY8VsK2s+zr2Z2l789Gl58G99wnw1uLwwI48oT6PbKF4A1IEURlDGAt WxhTPhWA/cwS+hZ2OfXZ10TU3A+/T+TBn7YIwZ2c7Ie1OQBovc3IQG5wSTQyeQ9jEIE5 RPYfO23PvzIRMNmIktHmHyI3+4QHX4y66SIO2yFgfhX5mKhCD1Pgyj2zk5+ReCy6TXXq k+jRuViN1ublsmeOG6CIVoNM3d6Khq0ORGHCcq+oP93RMoSXCViIWcaxhjkM3jETm7IH 0iXjj0ikvLZe+xfiMv8mj4ERzE5dKCbp8dhBbEgLkuSSvgIEPNoCFkdEhvaiBDJA+9F8 pvCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w77si2315840oif.216.2020.02.13.22.56.29; Thu, 13 Feb 2020 22:56:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726080AbgBNGzI (ORCPT + 99 others); Fri, 14 Feb 2020 01:55:08 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39846 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbgBNGzI (ORCPT ); Fri, 14 Feb 2020 01:55:08 -0500 Received: by mail-wr1-f67.google.com with SMTP id y11so9600713wrt.6 for ; Thu, 13 Feb 2020 22:55:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=eI86x/JvrHy/AVCnRwQ8huawbMtougjhcECL9y/T5ag=; b=TSER4SJ3Y+W1s5SImY4MjN2muMiHcYTlnNCIacF8LUfwwub6A/C2m7GBBtMvQ9cvaL PEj8aCYyUC03pmEGCtSopfRrKi2ZhVBZcHJZe1BmFQUtQaS10m9MR0J2tdygCPXaIiSX L776COudj3tLjxGNEhH36SI6lxJ73rpxbNWqJX/OceH6oHS0WQ7wUSi9tIdfqe+YrXIA ALnQXrd20bir0xuTxgY/CbI+bjGa0wwFRwDkAWoWEqUZZQx0qIdh6U5PrBt4pQh+nPb0 CqK6YN9ssSI71iIJQqIlNabF8G93WYtZR0qKLD67AhMKMakRNnX9DhCa/FVI+oD2pJVN /CXA== X-Gm-Message-State: APjAAAW72hqgIoLCI3FLostpK+nmu7GIUy/NGpJp0HclS9aY72HD4r3I vikJdBQb3PiFPdMiF5ar5Xc= X-Received: by 2002:a05:6000:1187:: with SMTP id g7mr2171193wrx.109.1581663306520; Thu, 13 Feb 2020 22:55:06 -0800 (PST) Received: from localhost (ip-37-188-133-87.eurotel.cz. [37.188.133.87]) by smtp.gmail.com with ESMTPSA id m9sm5915978wrx.55.2020.02.13.22.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 22:55:05 -0800 (PST) Date: Fri, 14 Feb 2020 07:55:04 +0100 From: Michal Hocko To: Matthew Wilcox Cc: Cong Wang , LKML , Andrew Morton , linux-mm , Mel Gorman , Vlastimil Babka Subject: Re: [PATCH] mm: avoid blocking lock_page() in kcompactd Message-ID: <20200214065504.GK31689@dhcp22.suse.cz> References: <20200127190653.GA8708@bombadil.infradead.org> <20200128081712.GA18145@dhcp22.suse.cz> <20200128083044.GB6615@bombadil.infradead.org> <20200128091352.GC18145@dhcp22.suse.cz> <20200128104857.GC6615@bombadil.infradead.org> <20200128113953.GA24244@dhcp22.suse.cz> <20200213074847.GB31689@dhcp22.suse.cz> <20200213164607.GR7778@bombadil.infradead.org> <20200213170824.GJ31689@dhcp22.suse.cz> <20200214042724.GY7778@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200214042724.GY7778@bombadil.infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 13-02-20 20:27:24, Matthew Wilcox wrote: > On Thu, Feb 13, 2020 at 06:08:24PM +0100, Michal Hocko wrote: > > On Thu 13-02-20 08:46:07, Matthew Wilcox wrote: > > > On Thu, Feb 13, 2020 at 08:48:47AM +0100, Michal Hocko wrote: > > > > Can we pursue on this please? An explicit NOFS scope annotation with a > > > > reference to compaction potentially locking up on pages in the readahead > > > > would be a great start. > > > > > > How about this (on top of the current readahead series): > > > > > > diff --git a/mm/readahead.c b/mm/readahead.c > > > index 29ca25c8f01e..32fd32b913da 100644 > > > --- a/mm/readahead.c > > > +++ b/mm/readahead.c > > > @@ -160,6 +160,16 @@ unsigned long page_cache_readahead_limit(struct address_space *mapping, > > > .nr_pages = 0, > > > }; > > > > > > + /* > > > + * Partway through the readahead operation, we will have added > > > + * locked pages to the page cache, but will not yet have submitted > > > + * them for I/O. Adding another page may need to allocate > > > + * memory, which can trigger memory migration. Telling the VM > > > > I would go with s@migration@compaction@ because it would make it more > > obvious that this is about high order allocations. > > Perhaps even just 'reclaim' -- it's about compaction today, but tomorrow's > VM might try to reclaim these pages too. They are on the LRU, after all. > > So I currently have: > > /* > * Partway through the readahead operation, we will have added > * locked pages to the page cache, but will not yet have submitted > * them for I/O. Adding another page may need to allocate memory, > * which can trigger memory reclaim. Telling the VM we're in > * the middle of a filesystem operation will cause it to not > * touch file-backed pages, preventing a deadlock. Most (all?) > * filesystems already specify __GFP_NOFS in their mapping's > * gfp_mask, but let's be explicit here. > */ OK, Thanks! -- Michal Hocko SUSE Labs