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 2145AC433E1 for ; Thu, 18 Jun 2020 17:35:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DA6262067D for ; Thu, 18 Jun 2020 17:35:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UnJVvr0v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA6262067D 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 65E6E8D004B; Thu, 18 Jun 2020 13:35:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60E8D8D0018; Thu, 18 Jun 2020 13:35:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FD548D004B; Thu, 18 Jun 2020 13:35:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 34A4E8D0018 for ; Thu, 18 Jun 2020 13:35:26 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C0982824805A for ; Thu, 18 Jun 2020 17:35:25 +0000 (UTC) X-FDA: 76943034210.22.spade23_611703326e12 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 91F53180CE20C for ; Thu, 18 Jun 2020 17:35:25 +0000 (UTC) X-HE-Tag: spade23_611703326e12 X-Filterd-Recvd-Size: 5220 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Jun 2020 17:35:24 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id 9so8260419ljv.5 for ; Thu, 18 Jun 2020 10:35:24 -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=2dnP8qUYYyaFpZ3zTbvKqOauflmJ29SpLJF29OdRiCY=; b=UnJVvr0vjgrNwYCuzGQ6Zwo0ZVOh/xGkhHUBk/0FzT/T+Ziki1U2FpCULJ6P04LVov JURhpY1o6uMKtJhlLf1rU1t0Et/tIhjTe6Ph/AdJ8FPnrhTLQVBacPE0hUXobrMePabw vouH+VTXBH8gtFwRihx66ME4fgW8MqQrRJYKM1ByaJBompes1rA7HRt0N4Izz2T5bHdf Xb76GGTOw60NJVLmPZCpl71bjGxL8Y3+niDOZqPT2czIf///ZMo+5MjG4XdPCXswIWRa vKCYkgC9UBOY4xne6+RfrbTwTqu4UogFTG05Yvxb2k5n/z2CoiUgrEMxfvZJpuIx/gk0 48QA== 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=2dnP8qUYYyaFpZ3zTbvKqOauflmJ29SpLJF29OdRiCY=; b=C5h53y37FVn8wThntwXXtLWZGGSAHJvThplzVdjTgm2yAjsHkryVBdu+6AiM6Hxgci 1yX7yGwLuTQOX1MT+U/UykTePY61oVNXz2KL/GmbWjnFNtvtUuAXgQwdwcTTWtu7KHXV Z2BEYneI9F63NSL+qHkbyxSK8GkpEwxGpuR5gDVF0K9WrHXBsO8YtXsPFehJKPcGstIi 1+y7phN2tiOAd680xguHwXQPDWqWh5Vqn+Kyd1uEtlb7MIbw1aYoBrQ4n2gcltIf/33t siV1+9LbWPPJpkQi81OLVtbfBZDuZutZz1day3jxm72gQn2iEmalAq50NXwJtcgq8rYF 10tw== X-Gm-Message-State: AOAM530/GhmWjTjtFzK4XIoqCZrorVgjaU14e6OR0xTBycSTwPZIzex2 XnuQMYqXa+Qaqdm3eYjmXGU= X-Google-Smtp-Source: ABdhPJyRHfUAtfaXLaXdDIJZ3o3g1DeSegfwsePEd6xOssh783a7fX4fLQEGbc4AJvcyRvrKKGGOHw== X-Received: by 2002:a05:651c:29b:: with SMTP id b27mr2725268ljo.454.1592501723586; Thu, 18 Jun 2020 10:35:23 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id t11sm427510lfc.24.2020.06.18.10.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 10:35:22 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 18 Jun 2020 19:35:20 +0200 To: "Paul E. McKenney" Cc: Matthew Wilcox , "Uladzislau Rezki (Sony)" , LKML , linux-mm@kvack.org, Andrew Morton , "Theodore Y . Ts'o" , Joel Fernandes , RCU , Oleksiy Avramchenko Subject: Re: [PATCH v2 09/16] rcu/tree: Maintain separate array for vmalloc ptrs Message-ID: <20200618173520.GC14613@pc636> References: <20200525214800.93072-1-urezki@gmail.com> <20200525214800.93072-10-urezki@gmail.com> <20200617234609.GA10087@paulmck-ThinkPad-P72> <20200618005214.GN8681@bombadil.infradead.org> <20200618031823.GQ2723@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200618031823.GQ2723@paulmck-ThinkPad-P72> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 91F53180CE20C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: > > > > I don't think that replacing direct function calls with indirect function > > calls is a great suggestion with the current state of play around branch > > prediction. > > > > I'd suggest: > > > > rcu_lock_acquire(&rcu_callback_map); > > trace_rcu_invoke_kfree_bulk_callback(rcu_state.name, > > bkvhead[i]->nr_records, bkvhead[i]->records); > > if (i == 0) { > > kfree_bulk(bkvhead[i]->nr_records, > > bkvhead[i]->records); > > } else { > > for (j = 0; j < bkvhead[i]->nr_records; j++) { > > vfree(bkvhead[i]->records[j]); > > } > > } > > rcu_lock_release(&rcu_callback_map); > > > > But I'd also suggest a vfree_bulk be added. There are a few things > > which would be better done in bulk as part of the vfree process > > (we batch them up already, but i'm sure we could do better). > > I suspect that he would like to keep the tracing. > > It might be worth trying the branches, given that they would be constant > and indexed by "i". The compiler might well remove the indirection. > > The compiler guys brag about doing so, which of course might or might > not have any correlation to a given compiler actually doing so. :-/ > > Having a vfree_bulk() might well be useful, but I would feel more > confidence in that if there were other callers of kfree_bulk(). > Hmm... I think replacing that with vfree_bulk() is a good idea though. > > But again, either way, future work as far as this series is concerned. > What do you mean: is concerned? We are planning to implement kfree_rcu() to be integrated directly into SLAB: SLAB, SLUB, SLOB. So, there are plenty of future work :) -- Vlad Rezki