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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 CC456C433E0 for ; Wed, 27 Jan 2021 20:42:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C9D561488 for ; Wed, 27 Jan 2021 20:42:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C9D561488 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 48AB46B0006; Wed, 27 Jan 2021 15:42:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 43ADE6B006C; Wed, 27 Jan 2021 15:42:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 351046B006E; Wed, 27 Jan 2021 15:42:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id 1E1986B0006 for ; Wed, 27 Jan 2021 15:42:51 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D06A9180AD81F for ; Wed, 27 Jan 2021 20:42:50 +0000 (UTC) X-FDA: 77752728900.01.cloud77_280e7fd2759a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id B119D1004EC4D for ; Wed, 27 Jan 2021 20:42:50 +0000 (UTC) X-HE-Tag: cloud77_280e7fd2759a X-Filterd-Recvd-Size: 5171 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 20:42:50 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id p15so1985879pjv.3 for ; Wed, 27 Jan 2021 12:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=heAqkYphZYwX3mYVMDdP10R2l2TFo2HmDmbz1DiFkNE=; b=K0T81wAKtAFxYGJqnI8tNi9jqePKm9zDwFtaAH9ROlxwFJ3ja4XBrZdQlyTB3YScyf Vs4wulo78erERFxQi1GI3/yzOPf8n2KcHcd6ZaZNx13DndiA8fyqLbb1rUQk4PdQF83O +xVsD8JcOvts1HfSuUZJsVjhIrP+d+n14QYMS5S+cFI/6r9FFVUZY8rsLK3Fh06ERuP4 M3634ytlArQvdjfLm0ABdYmDYFPOAxhp65cYAgefIb3U+yukrn/HuaRK7FzQaxVcbjcI 5MTN0gqK/4/1MKgl3iyejTRBDCFeT57wU5DZmJG4owiXL9r7dttpDJI9Uh6WClas3X9O TjwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=heAqkYphZYwX3mYVMDdP10R2l2TFo2HmDmbz1DiFkNE=; b=JMxfaFV2uJBDNd10a4IoiRkp3IDIKWcc7yhW+cv8DL8icxSCc26ocvAhzJe3PrswaT abYB+gouM5d7MQPj1wOkCim8f3p1/Pgefn4Vw9vJ8UytDF+pXixb5ZwugfNPcMeP03Js CVSZh5R35JwxZzqQdr45xaqOVVckFVKBHiAlMw1ZJ1ndAY1MpgTEGkUBipTZ8+AfDSBR DbP4ookJyxj1C48poZQiBVVOqdVEI6hoadDxn4hRF2xjIbzFVrkVqMCmj4R4FXsFL2F1 nSh5E6cALNNrSpoXwf9+UeHXf/Ls9HSdlX13ZBcR6FkC+ROTFETVRSERnTBxJ+pDkwBB zaWw== X-Gm-Message-State: AOAM530k+2uh7p9xgiWtc7kSEdvJrufgCD5qEq2LOOAEgv6hHWujw77q oS6RzApEOs6N6Zu0230XsI0= X-Google-Smtp-Source: ABdhPJyrDUsN/Czs9FxNo3YQSGdUkHSsN4MG+RN/LXd3icOH8HO4d6Aya9e6WjnHk3Ic8QmrVWjzeQ== X-Received: by 2002:a17:902:edcd:b029:df:d2b1:ecf0 with SMTP id q13-20020a170902edcdb02900dfd2b1ecf0mr13184394plk.15.1611780169223; Wed, 27 Jan 2021 12:42:49 -0800 (PST) Received: from google.com ([2620:15c:211:201:9dd5:b47b:bb84:dede]) by smtp.gmail.com with ESMTPSA id a72sm3457344pfa.126.2021.01.27.12.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 12:42:47 -0800 (PST) Date: Wed, 27 Jan 2021 12:42:45 -0800 From: Minchan Kim To: Michal Hocko Cc: Andrew Morton , linux-mm , LKML , hyesoo.yu@samsung.com, david@redhat.com, surenb@google.com, pullip.cho@samsung.com, joaodias@google.com, hridya@google.com, john.stultz@linaro.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, hch@infradead.org, robh+dt@kernel.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v4 2/4] mm: failfast mode with __GFP_NORETRY in alloc_contig_range Message-ID: References: <20210121175502.274391-1-minchan@kernel.org> <20210121175502.274391-3-minchan@kernel.org> <20210125131200.GG827@dhcp22.suse.cz> <20210126074449.GA827@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210126074449.GA827@dhcp22.suse.cz> 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 Tue, Jan 26, 2021 at 08:44:49AM +0100, Michal Hocko wrote: > On Mon 25-01-21 11:33:36, Minchan Kim wrote: > > On Mon, Jan 25, 2021 at 02:12:00PM +0100, Michal Hocko wrote: > > > On Thu 21-01-21 09:55:00, Minchan Kim wrote: > > > > Contiguous memory allocation can be stalled due to waiting > > > > on page writeback and/or page lock which causes unpredictable > > > > delay. It's a unavoidable cost for the requestor to get *big* > > > > contiguous memory but it's expensive for *small* contiguous > > > > memory(e.g., order-4) because caller could retry the request > > > > in different range where would have easy migratable pages > > > > without stalling. > > > > > > > > This patch introduce __GFP_NORETRY as compaction gfp_mask in > > > > alloc_contig_range so it will fail fast without blocking > > > > when it encounters pages needed waiting. > > > > > > I am not against controling how hard this allocator tries with gfp mask > > > but this changelog is rather void on any data and any user. > > > > > > It is also rather dubious to have retries when then caller says to not > > > retry. > > > > Since max_tries is 1 with ++tries, it shouldn't retry. > > OK, I have missed that. This is a tricky code. ASYNC mode should be > completely orthogonal to the retries count. Those are different things. > Page allocator does an explicit bail out based on __GFP_NORETRY. You > should be doing the same. Before sending next revision, let me check this part again. I want to use __GFP_NORETRY to indicate "opportunistic-easy-to-fail attempt" and I want to use ASYNC migrate_mode to help the goal. Do you see the problem?