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=-2.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 E6C6DC47257 for ; Mon, 4 May 2020 12:46:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB5182071C for ; Mon, 4 May 2020 12:46:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f5hrseaH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB5182071C 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 4716B8E000B; Mon, 4 May 2020 08:46:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FAED8E0003; Mon, 4 May 2020 08:46:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C2B68E000B; Mon, 4 May 2020 08:46:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 11A738E0003 for ; Mon, 4 May 2020 08:46:03 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3EB70181AEF09 for ; Mon, 4 May 2020 12:46:02 +0000 (UTC) X-FDA: 76779008964.16.apple40_34a6b0f2b0b25 X-HE-Tag: apple40_34a6b0f2b0b25 X-Filterd-Recvd-Size: 4865 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 May 2020 12:46:01 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id y4so9479453ljn.7 for ; Mon, 04 May 2020 05:46:01 -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=MxtvJADHQyF2Bfyd3shzrzOV9msYv3TiT6BAQiW+KhI=; b=f5hrseaHOwjQMXJt8bBACt6DaEIHexL3hv/OOA/rVyWM1tWtk+sIH+NdF5cNVNVhN5 qKA3GFB/imTK1sicAOYYj5xW2DmIA1vbJtN3nk43C2BxXlCOZGvEx5+HaoDiOr0gEe8P b9lbbtykY/8gFZ6dtFAMjZILSNyQvimUYRYp/7Hoj4yjX7fjaJVEZZZkmghiiaVuqkxJ Izl12k3Dleo6+leSUvmD8e66qM+dCmn9I9WhvGAhO02Ng8NufCBXJ1FPhKWQKrWb0gER m293HKARydc4lfUPPSyYtWXgHLYleszKk75AXRlG6i2h/n+v1SbECwX4b1SjTDdKXb/s QFtA== 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=MxtvJADHQyF2Bfyd3shzrzOV9msYv3TiT6BAQiW+KhI=; b=FrCS6UZOUmCJkIlxMAwns0G1D9rR4DXA5GR3Jh+NL0OUTbyQg9w8OLuSPf4jtBgFiA dn5QnNqg4qsa/KIfQnnsD3NrA4/oa9qLltAA2O7D79xYSStU+A1mVFr/WaR6RsVQoWYq 2e62dF6P2VpdYMEaIaT7WI9b9hmxLNxOLg8B5iJwqsbt3E6pPeU82Vj35EnBnoaOZfNj tBYz0/hCgFalrgFEUB6LYJr6PLJqzzulUTpuyV4RrFVzX0eAk3Wqd/crU5w6RwNA2Uwp v09TvKfCmEPWWWBwtsQusQ0+koAz4m4mofWa2DhDx1RkPhGKsGnxOAlWWxW/20WdsmyT 0oNQ== X-Gm-Message-State: AGi0Puagdd+aXXepqST7qm6dmhftJ4P2KLyp8423w+996UqQ4+dy5TBL ygkvIXUn8dc/Emvqs7VyBBs= X-Google-Smtp-Source: APiQypJTSD+9jSx9npyWswKL3jKL6Fr3OUB38jOmcbJ2+udY4w2QdHHBJWxIzAa5v4c/b0ZTMcE0BA== X-Received: by 2002:a2e:9048:: with SMTP id n8mr10552753ljg.122.1588596360414; Mon, 04 May 2020 05:46:00 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id s8sm9570030lfd.61.2020.05.04.05.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 05:45:59 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Mon, 4 May 2020 14:45:57 +0200 To: Joel Fernandes Cc: "Paul E. McKenney" , "Uladzislau Rezki (Sony)" , LKML , linux-mm@kvack.org, Andrew Morton , "Theodore Y . Ts'o" , Matthew Wilcox , RCU , Oleksiy Avramchenko Subject: Re: [PATCH 22/24] rcu/tiny: support reclaim for head-less object Message-ID: <20200504124557.GD17577@pc636> References: <20200428205903.61704-1-urezki@gmail.com> <20200428205903.61704-23-urezki@gmail.com> <20200501230638.GI7560@paulmck-ThinkPad-P72> <20200504002700.GB212435@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200504002700.GB212435@google.com> 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: On Sun, May 03, 2020 at 08:27:00PM -0400, Joel Fernandes wrote: > On Fri, May 01, 2020 at 04:06:38PM -0700, Paul E. McKenney wrote: > > On Tue, Apr 28, 2020 at 10:59:01PM +0200, Uladzislau Rezki (Sony) wrote: > > > Make a kvfree_call_rcu() function to support head-less > > > freeing. Same as for tree-RCU, for such purpose we store > > > pointers in array. SLAB and vmalloc ptrs. are mixed and > > > coexist together. > > > > > > Under high memory pressure it can be that maintaining of > > > arrays becomes impossible. Objects with an rcu_head are > > > released via call_rcu(). When it comes to the head-less > > > variant, the kvfree() call is directly inlined, i.e. we > > > do the same as for tree-RCU: > > > a) wait until a grace period has elapsed; > > > b) direct inlining of the kvfree() call. > > > > > > Thus the current context has to follow might_sleep() > > > annotation. Also please note that for tiny-RCU any > > > call of synchronize_rcu() is actually a quiescent > > > state, therefore (a) does nothing. > > > > Please, please, please just do synchronize_rcu() followed by kvfree() > > for single-argument kfree_rcu() and friends in Tiny RCU. > > > > Way simpler and probably way faster as well. And given that Tiny RCU > > runs only on uniprocessor systems, the complexity probably is buying > > you very little, if anything. > > Agreed. > Cool. Agree also :) -- Vlad Rezki