Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3084969pxb; Mon, 25 Jan 2021 06:38:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLtsj2AVjnRmjp/LZp+eYPgDL41ad6urArSFT8RKLarz7M9DBCpF0WqeFDij0n5rmX5FfI X-Received: by 2002:a17:906:c00c:: with SMTP id e12mr550319ejz.103.1611585484866; Mon, 25 Jan 2021 06:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611585484; cv=none; d=google.com; s=arc-20160816; b=zbW7BVVj4scTOwvAlpUkNZGfn96CZUyQ8gyfWqFAz+w/oaT+HBQ0MOhjOeuevzfNX0 u8+nTUzwCsxlrvsL9U1lmJlSkm9ZlWH4NOvozYSOhfKfRTN93q801XtKrrMHMEak3C+2 piF1ilBQ3cQgonHsPSE8YvZHl0fAa1nAgCIJ75pEMMwkZ9P8Kqq9jE/Y6Tlt4VxRGMw2 8wgEF8k1rROHM30wKlSfhtzJ9ElUpT8xN7oBE8/VNxkQ7tqbUBzxc+LRzUy+uDgNLtN/ QmrB6+KNcglgb6gdTtiUqWNvjKLNKLAk3fSYTW6Rr5nHHvONt7m+PP0ARSHcTzUIv7ct 8FoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=J81vU0UwWpEHhAfUrDasXcHzBdqWSd90SVkou0JGu4s=; b=deYbjqAX/w21spcDjHZ9KRTpGpGScl7TaYJbN9b5XFF6JmGFanVN7dsBGS69rdLZzr TpcXTBYKXDzCq+Gx43oewEKwdg8IxgODDiT7QM9fO0+m6nj/zzrd9hG80vkITyxyamBI Ew1TJWswC6sFl08gIdccwUUB9n5dy+fOjnlxfnkmCaQrhp21HAYuO4qPHIEhnlKIt06C eWZrspg5rtdWVhEKFJhmzkR5LDVzlem35VvkqSvgt69xrdI20jNvJYNsvx/dzc9Ra/UP mh8wGG9/IRTGIfZTgQDX9NTsGovisvfqO9IDEhNhwb51wFG+fG4Elz/Abayig3588bel 8Gjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Aa5iatRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga14si6144735ejb.267.2021.01.25.06.37.28; Mon, 25 Jan 2021 06:38:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Aa5iatRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729498AbhAYOeG (ORCPT + 99 others); Mon, 25 Jan 2021 09:34:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729467AbhAYOcf (ORCPT ); Mon, 25 Jan 2021 09:32:35 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B115BC06178A; Mon, 25 Jan 2021 06:31:54 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id b26so17998721lff.9; Mon, 25 Jan 2021 06:31:54 -0800 (PST) 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=J81vU0UwWpEHhAfUrDasXcHzBdqWSd90SVkou0JGu4s=; b=Aa5iatRhzwdZySQ1I03K4tT8lWwA7lItloapzYsFQhLCzD4Zkwi7Z2RhdRhdmh2FX5 Uf1ID4KlMe74ptwxWoxkDlDNun/NFbcBQl2IkjIw56m1gAZziRcKw1HIofFxbyr7/T0K AvBID7qGAY3jpcyqPcbhojR874K43pRgxGgt545/awcFhzQJfzW4ygq+JBXuKB43f6wP Tox+5e2RyvBVxCIxfqAUItBOWNOmPRtVDwB5tsihVoyF+bHZP1+h/6V6YpzB0URyXv5M DEaNSPRiprsZ9YmfBLxYx98KkluAG2oE0XiVeImrQQx9lwtB/pvlObMenied/zkscs6R 1evw== 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=J81vU0UwWpEHhAfUrDasXcHzBdqWSd90SVkou0JGu4s=; b=fVGuLAco5PO0OnutjMfxiJLYEeQBv3+A8D+XZrwjrQ3wX18hcL3HSWXNQqlvt4ql1D p4MIwMFdoy5/s3kiGhbnH+zO58WoBnSFPLDSePMuu8m6PqgqU6FhAF5fYmHc5tI8srnC SKRPE7adE2kDGNMSiSYESYXIlGEp0O+0Y8xzvYaNL17HSPZJkM7O6nHa92V9yQqOPerm 5w6HNwIFRUWuF9zJOkxUGz/m0LeNfmGyWf9RwSwLziYEiSuzWTEtl/1axsatYoZbwavd PPbcd55FrvFDHfLABfPQoGyb7rgUaNZ9zFAQJdXkeL3yh6Ua+/qKIniwkdpLmJluxlob OQ9Q== X-Gm-Message-State: AOAM530zI+30qa4umvXEOcmtq5lwb/dR6D548gRClORQ8yEXlZXQtrB3 eEaNX71clF34VBEKUIHd9uc= X-Received: by 2002:a05:6512:a8e:: with SMTP id m14mr381149lfu.641.1611585113193; Mon, 25 Jan 2021 06:31:53 -0800 (PST) Received: from pc638.lan (h5ef52e3d.seluork.dyn.perspektivbredband.net. [94.245.46.61]) by smtp.gmail.com with ESMTPSA id c14sm1934922lfd.186.2021.01.25.06.31.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 06:31:52 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Mon, 25 Jan 2021 15:31:50 +0100 To: Michal Hocko Cc: "Uladzislau Rezki (Sony)" , LKML , RCU , "Paul E . McKenney" , Michael Ellerman , Andrew Morton , Daniel Axtens , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Peter Zijlstra , Thomas Gleixner , "Theodore Y . Ts'o" , Sebastian Andrzej Siewior , Oleksiy Avramchenko Subject: Re: [PATCH 1/3] kvfree_rcu: Allocate a page for a single argument Message-ID: <20210125143150.GA2282@pc638.lan> References: <20210120162148.1973-1-urezki@gmail.com> <20210125132236.GJ827@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210125132236.GJ827@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Wed 20-01-21 17:21:46, Uladzislau Rezki (Sony) wrote: > > For a single argument we can directly request a page from a caller > > context when a "carry page block" is run out of free spots. Instead > > of hitting a slow path we can request an extra page by demand and > > proceed with a fast path. > > > > A single-argument kvfree_rcu() must be invoked in sleepable contexts, > > and that its fallback is the relatively high latency synchronize_rcu(). > > Single-argument kvfree_rcu() therefore uses GFP_KERNEL|__GFP_RETRY_MAYFAIL > > to allow limited sleeping within the memory allocator. > > __GFP_RETRY_MAYFAIL can be quite heavy. It is effectively the most heavy > way to allocate without triggering the OOM killer. Is this really what > you need/want? Is __GFP_NORETRY too weak? > Hm... We agreed to proceed with limited lightwait memory direct reclaim. Johannes Weiner proposed to go with __GFP_NORETRY flag as a starting point: https://www.spinics.net/lists/rcu/msg02856.html So I'm inclined to suggest __GFP_NORETRY as a starting point, and make further decisions based on instrumentation of the success rates of these opportunistic allocations. but for some reason, i can't find a tail or head of it, we introduced __GFP_RETRY_MAYFAIL what is a heavy one from a time consuming point of view. What we would like to avoid. I tend to say that it was a typo. Thank you for pointing to it! -- Vlad Rezki