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=-5.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 C51AFC43331 for ; Wed, 1 Apr 2020 15:46:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7CF2720B1F for ; Wed, 1 Apr 2020 15:46:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tZRaDOcY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CF2720B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 249C18E0005; Wed, 1 Apr 2020 11:46:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FA888E0001; Wed, 1 Apr 2020 11:46:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 138408E0005; Wed, 1 Apr 2020 11:46:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id EEDFE8E0001 for ; Wed, 1 Apr 2020 11:46:31 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AB19C181AC9CC for ; Wed, 1 Apr 2020 15:46:31 +0000 (UTC) X-FDA: 76659713382.11.joke95_90425ad68f64a X-HE-Tag: joke95_90425ad68f64a X-Filterd-Recvd-Size: 5267 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Wed, 1 Apr 2020 15:46:31 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id p14so26269711lji.11 for ; Wed, 01 Apr 2020 08:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eGo2AC3bFo0cX0Y80FNvQpP9bE2/c336JeB41lJRyRE=; b=tZRaDOcYiY6nTed7mYmAPRDObnjaWlOo8msoex1+RLkm5gRTGA7S/T7pIUv688qVWC 9KQtH9PEB9F9WD9iur48UFi0rhlm5OlkBh4BC56uASN6dSjf/4yz/puLfcZwm9ovxsMm ZIuNxR4sMs2HNZHIAQ05TJQbaKiy6joyqe0KXFvDo1VW/jpri9RYQJkSWFXp+91cFSO/ nOjcwx+pmIYUBonKXicJWR2I/gDWlGfRoOpHFdlRQmcU+llIMqvdV2pCVTPdKOBrTwvF SwC51wSyLqib99jVteWF9BH+lDGytmvrIdEN5YhNrhhnsXiQyvdyOPTo/d1+eJ+0D1Ra 4zfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eGo2AC3bFo0cX0Y80FNvQpP9bE2/c336JeB41lJRyRE=; b=oRMTRirflm2POiJufa5j9wNnn7BFyPxwvkhkOcjA6LRfBUC13q3H674zlC+hGpYBZh wwag3HBZfRkrjlJeNGV82kXYYvDZwPXLppN3mBfs2QYaDAHkOTEZo+PHHwqKgFfANC0e w6SFv1zrGpn+Ux5DG41R/sO0P+XopOPldLf1WhXuze8syDH/ZWks70nfAXpxM3WzzrC7 77QEKvaf2J9do9LGqQPuflhX45UQkI+5axg1CmfBBor2MQkzc4/IUdhrcqcC3r/QbAAy Vi7HaYMVXHNA6ZuxOTcg76Aov8AfxpXUknSOMOGS/EcqQL9DD6WnyZTWZpUAz/obhqKT HwkQ== X-Gm-Message-State: AGi0PubgG7d7ECtYWd+4w/KFFAUy4GIVO9eZqDpkDEKdnoLYMOn/e0t0 3ngFp8CiKCzh9BZkEFUSEnU= X-Google-Smtp-Source: APiQypL/Qg1CoRp9yBB1IV0crCY7gmXDJZBXEVq3T4dQMlAcRYjXGvdxK6t57DKmKs/y3+6db0r/vQ== X-Received: by 2002:a2e:8195:: with SMTP id e21mr13332304ljg.49.1585755989539; Wed, 01 Apr 2020 08:46:29 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id v20sm1839292lfe.52.2020.04.01.08.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 08:46:28 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 1 Apr 2020 17:46:18 +0200 To: Michal Hocko Cc: Uladzislau Rezki , Joel Fernandes , linux-kernel@vger.kernel.org, linux-mm@kvack.org, rcu@vger.kernel.org, willy@infradead.org, peterz@infradead.org, neilb@suse.com, vbabka@suse.cz, mgorman@suse.de, Andrew Morton , Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , "Paul E. McKenney" , Steven Rostedt Subject: Re: [PATCH RFC] rcu/tree: Use GFP_MEMALLOC for alloc memory to free memory pattern Message-ID: <20200401154618.GA3907@pc636> References: <20200331145806.GB236678@google.com> <20200331153450.GM30449@dhcp22.suse.cz> <20200331161215.GA27676@pc636> <20200401070958.GB22681@dhcp22.suse.cz> <20200401123230.GB32593@pc636> <20200401125503.GJ22681@dhcp22.suse.cz> <20200401130816.GA1320@pc636> <20200401131528.GK22681@dhcp22.suse.cz> <20200401132258.GA1953@pc636> <20200401152805.GN22681@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401152805.GN22681@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) 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: > > > > > > OK, if you are always in the atomic context then GFP_ATOMIC is > > > sufficient. __GFP_RETRY_MAYFAIL will make no difference for allocations > > > which do not reclaim (and thus not retry). Sorry this was not clear to > > > me from the previous description. > > > > > Ahh. OK. Then adding __GFP_RETRY_MAYFAIL to GFP_ATOMIC will not make any effect. > > > > Thank you for your explanation! > > Welcome. I wish all those gfp flags were really clear but I fully > understand that people who are not working with MM regurarly might find > it confusing. Btw. have __GFP_RETRY_MAYFAIL is documented in gfp.h and > it is documented as the reclaim modifier which should imply that it has > no effect when the reclaim is not allowed which is the case for any non > sleeping allocation. If that relation was not immediately obvious then I > think we need to make it explicit. Would you find it useful? > > E.g. > > diff --git a/include/linux/gfp.h b/include/linux/gfp.h > index e3ab1c0d9140..8f09cefdfa7b 100644 > --- a/include/linux/gfp.h > +++ b/include/linux/gfp.h > @@ -127,6 +127,8 @@ struct vm_area_struct; > * > * Reclaim modifiers > * ~~~~~~~~~~~~~~~~~ > + * Please note that all the folloging flags are only applicable to sleepable > + * allocations (e.g. %GFP_NOWAIT and %GFP_ATOMIC will ignore them). > * > * %__GFP_IO can start physical IO. > * That would be definitely clear for me! -- Vlad Rezki