From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F7E4C35242 for ; Fri, 14 Feb 2020 06:55:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 455FB2082F for ; Fri, 14 Feb 2020 06:55:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 455FB2082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C04916B05FC; Fri, 14 Feb 2020 01:55:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B8D7C6B05FD; Fri, 14 Feb 2020 01:55:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A55086B05FE; Fri, 14 Feb 2020 01:55:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id 866C46B05FC for ; Fri, 14 Feb 2020 01:55:08 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0D967181AEF21 for ; Fri, 14 Feb 2020 06:55:08 +0000 (UTC) X-FDA: 76487820696.13.time01_2cc6c85290d14 X-HE-Tag: time01_2cc6c85290d14 X-Filterd-Recvd-Size: 4857 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Feb 2020 06:55:07 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id m16so9581488wrx.11 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=BItlkEnqDb2FIG0pLQmQEyBpo7t1juczuGTBaxKSQcBaKkVgN2hoyZWhWhFbHGaEbn 93qqw2ijG/8IG9VQa08SjVbrPWhPfdM5fLg5xOr/f/wE2QiauExLD8WVtO+m6fmkLzIM Z+0zV3SaPsNPekyGStIpgZbI1Cx8rm5t2oCxfYjf2He6rY9zxBwsBrEjax69opLz5m8d +ffzBoi6lamGrLqcf649lgGY+yISTiE5cvR4bDfWyzg3H4JaQhg8V8Tm7MVdukp5+KJz gxF9/IV1NypZiyHOticiRHrEf/Q6HjFmciTa3HpBZOeuCa6IN5Edad6xQeIyCpUJXmcq PI6w== X-Gm-Message-State: APjAAAX2yJoi4RWSc6Xdj23dTGbnEGAZwi3ijkrQs4xfwk1NIod5TIwt bspHL2MQvhAMIV5ZKbMfVgA= X-Google-Smtp-Source: APXvYqxa99Wwo6T/pCkhaObjWkD992aRkrtEM3E65/y3wBf3rEiCXeJZgNEGE0MLmnuAhlfpzODBHQ== 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> 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: 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