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 278B3C433E0 for ; Thu, 28 Jan 2021 16:56:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8E29964E12 for ; Thu, 28 Jan 2021 16:56:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E29964E12 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 DCCEB6B0074; Thu, 28 Jan 2021 11:56:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA2856B0075; Thu, 28 Jan 2021 11:56:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C915E6B0078; Thu, 28 Jan 2021 11:56:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id B295E6B0074 for ; Thu, 28 Jan 2021 11:56:55 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6E5411EF1 for ; Thu, 28 Jan 2021 16:56:55 +0000 (UTC) X-FDA: 77755788390.11.class82_50123ee275a1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 47A29180F8B82 for ; Thu, 28 Jan 2021 16:56:55 +0000 (UTC) X-HE-Tag: class82_50123ee275a1 X-Filterd-Recvd-Size: 5845 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 16:56:54 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id n10so4646542pgl.10 for ; Thu, 28 Jan 2021 08:56:54 -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=r4OzxVPLRoxlIyBDmEaW5Gd8mifxKGEhoqDq5Ke4XvU=; b=cWYHo3RPLvuqgXqLWKeiAeSunxHnmoi2DfEH7VfWjBrdr4Ov0p30EeyqX1jvElHQnw jNSQyGAA9JuqxtS7r/yBIqRGkYh4Hk0K1FCGQWL5zTr3XVGVCI5DeMLaDHok9cGwq6gb Hmc59AwEsHp2Jopg9yMtO1+5UuVPKtxfCJXQjLK8oBtNxlTNdryepE3oWBlp2i6jHA0z UvGIEMfa0JNyEhqkBRVqgjYO+SZ2JRbyym6fdYN3b28c3xihMdvdP2fIHT67esPVS8yZ WIhVye57N6ISKGEKHRRU1WNqiyPw1dKC9l3F/0PqD9uuw0XY9fHuP/juCcbhR8IOChuc 0uUg== 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=r4OzxVPLRoxlIyBDmEaW5Gd8mifxKGEhoqDq5Ke4XvU=; b=bFDLO9G2gRaBNMbRGVic2g4M5z4aZxzB7oxVMNLUw9HIOblJy6ArfwmU7LFAKfQPGY bg7gEdjlyRpacutDvP0qUnqmHt3/4pUMuc9K/OKMOaG0T4YRS/y8PBlHxMaOWSfcjmGG OpWL+h9BWlzrM89GzhY5ljJrzua0qnrQXuSCT9Z4Z1Vzwk7fIpCvSmHnFESm4ghuQpMD JklS5qUO/m4EjC89CWLvuBN7uBIgxwu4WaUZ7H8iaSfWnZBH6X2egSr/AwwJdW/H61IT YC9YGGn6ZJRgEoOop3GTsXpV/IANYAr50XCOivMzmu7GOL/jYnNx7OonUILh6YUk9Y+a ApcQ== X-Gm-Message-State: AOAM530PTNXKgc8gZheKSkvMN31khyRYHqlDbQIL5uel6b8aCTJHiqF6 Bp76+m9l8td3Gj0dxv3uQ3M= X-Google-Smtp-Source: ABdhPJz2IVz9uK0AemB8mpqL5wrFV3zUb5iR4XhPWnwF3rqsqF67H6tg2c8B6kXfDP/+ZKAmd6XYxw== X-Received: by 2002:a63:ca45:: with SMTP id o5mr459086pgi.48.1611853013879; Thu, 28 Jan 2021 08:56:53 -0800 (PST) Received: from google.com ([2620:15c:211:201:885b:c20e:b832:f82]) by smtp.gmail.com with ESMTPSA id d133sm6037141pfd.6.2021.01.28.08.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 08:56:52 -0800 (PST) Date: Thu, 28 Jan 2021 08:56:50 -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: 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, Jan 28, 2021 at 08:53:25AM +0100, Michal Hocko wrote: > On Wed 27-01-21 12:42:45, Minchan Kim wrote: > > 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? > > No, as I've said. This is a normal NORETRY policy. And ASYNC migration > is a mere implementation detail you do not have bother your users about. > This is the semantic view. From the implementation POV it should be the > gfp mask to drive decisions rather than a random (ASYNC) flag to control > retries as you did here. Make sense. Let me cook next revision. Thanks for the review, Michal.