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=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 68A3FC4727F for ; Wed, 23 Sep 2020 11:27:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D5BF2235FC for ; Wed, 23 Sep 2020 11:27:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kPbMa256" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5BF2235FC 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 660C36B0055; Wed, 23 Sep 2020 07:27:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6105A6B005A; Wed, 23 Sep 2020 07:27:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B1016B005C; Wed, 23 Sep 2020 07:27:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0073.hostedemail.com [216.40.44.73]) by kanga.kvack.org (Postfix) with ESMTP id 2BD586B0055 for ; Wed, 23 Sep 2020 07:27:26 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DFFBE8249980 for ; Wed, 23 Sep 2020 11:27:25 +0000 (UTC) X-FDA: 77294100450.10.basin73_3b0415127156 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id BBE5316A4A1 for ; Wed, 23 Sep 2020 11:27:25 +0000 (UTC) X-HE-Tag: basin73_3b0415127156 X-Filterd-Recvd-Size: 6916 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Sep 2020 11:27:25 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id s205so16895568lja.7 for ; Wed, 23 Sep 2020 04:27:25 -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=PF60as8MpIwsxJIqqAOINxwtnO5aupgejkBPp4saGRI=; b=kPbMa256EDIOx6B5ZH/I6P8OuhTR0akW/H9eJ7j4yFwMH9vATN3TGA9nPT1oLbicn9 9wZ8Kzh23ymfDthKlHUqKejeXwDhmzBUiCJrfrk/ONnzdvxqFP+W2a91PTP+GVw9hkbK pAGvI0PTupNyEXsPZWhK8OAX8B3gGR2gy7Qs+O1Io+Y6gKDu2OZPsMpmIPdSmt1aU8hW wVAGSylLZ396/vgp60qJzCH5WFXiC2PtAG+SOtZrRFUTLqtbXayZDv3Jl7wVig5Gp526 dSqbZi1V9DxjWfM2Z5oDfrbgpILRRCb2+RoXIvBYYIZKG3ctB7+n3LN/MzE5WqklTMnn uiCQ== 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=PF60as8MpIwsxJIqqAOINxwtnO5aupgejkBPp4saGRI=; b=rugKSi6AvPqjV6V/nnoX5ywXRMlBBYNdrC8/0Rk8ZfCZOyrhkxiHhTZesh+XB+wKPN mSo2JHUH2J1G9TpZAY/+v75uh51Owy9hNoKkvv149AOoA7Vb4KNnvMMZNDcQKVRKPcxc OPY+BdGFiRumYsQCjfsSZfisgwa21LVqVcxRREyI2iowT4U/gy1ZbgYd44vcH3fzibWH F2h6icKp1LseE2jSS9HSlZKQF5RWGj9Wf7BDXVhhB8tung5UyW6A9LijFRDnE6pVaqs4 7S/YQqNj/3LXlxu1xewSms4ms+EUnieiurop1pYUC+18eqFBzMM1IV1Y8gst6OrZnPj6 jTBg== X-Gm-Message-State: AOAM5312Zmyx7SSiijEl0GK8e03q05yk+v+jJmW20p49JRCXR5UWnpnd 1AMElIvp6LHV8YXBFqjSwa0= X-Google-Smtp-Source: ABdhPJyjJ7gCM2EyR1iq96O3NkMTgpN2WZZdCb3tyuAX//K2341e1123fZlk9VT2Gj64jWc3o5ySnA== X-Received: by 2002:a2e:99c4:: with SMTP id l4mr3211132ljj.428.1600860443667; Wed, 23 Sep 2020 04:27:23 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id g26sm371781ljl.116.2020.09.23.04.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 04:27:22 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 23 Sep 2020 13:27:19 +0200 To: "Paul E. McKenney" , Michal Hocko , Thomas Gleixner Cc: Michal Hocko , "Uladzislau Rezki (Sony)" , LKML , RCU , linux-mm@kvack.org, Andrew Morton , Peter Zijlstra , Vlastimil Babka , Thomas Gleixner , "Theodore Y . Ts'o" , Joel Fernandes , Sebastian Andrzej Siewior , Oleksiy Avramchenko Subject: Re: [RFC-PATCH 2/4] mm: Add __rcu_alloc_page_lockless() func. Message-ID: <20200923112719.GA6796@pc636> References: <20200918194817.48921-1-urezki@gmail.com> <20200918194817.48921-3-urezki@gmail.com> <20200921074716.GC12990@dhcp22.suse.cz> <20200921154558.GD29330@paulmck-ThinkPad-P72> <20200921160318.GO12990@dhcp22.suse.cz> <20200922033553.GU29330@paulmck-ThinkPad-P72> <20200922080306.GV12990@dhcp22.suse.cz> <20200922154621.GW29330@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922154621.GW29330@paulmck-ThinkPad-P72> 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: > > > Other approaches under consideration include making CONFIG_PREEMPT_COUNT > > > unconditional and thus allowing call_rcu() and kvfree_rcu() to determine > > > whether direct calls to the allocator are safe (some guy named Linus > > > doesn't like this one), > > > > I assume that the primary argument is the overhead, right? Do you happen > > to have any reference? > > Jon Corbet wrote a very nice article summarizing the current situation: > https://lwn.net/Articles/831678/. Thomas's measurements show no visible > system-level performance impact. I will let Uladzislau present his more > microbenchmarky performance work. > I have done some analysis of the !PREEMPT kernel with and without PREEMPT_COUNT configuration. The aim is to show a performance impact if the PREEMPT_COUNT is unconditionally enabled. As for the test i used the refscale kernel module, that does: static void ref_rcu_read_section(const int nloops) { int i; for (i = nloops; i >= 0; i--) { rcu_read_lock(); rcu_read_unlock(); } } How to run the microbenchmark: urezki@pc638:~$ sudo modprobe refscale The below is an average duration per loop (nanoseconds): !PREEMPT_COUNT PREEMPT_COUNT Runs Time(ns) Runc Time(ns) 1 109.640 1 99.915 2 102.303 2 111.106 3 90.520 3 98.713 4 106.347 4 111.239 5 108.374 5 111.797 6 108.012 6 111.558 7 103.989 7 113.122 8 106.194 8 111.515 9 107.330 9 107.559 10 105.877 10 105.965 11 104.860 11 104.835 12 104.299 12 106.342 13 104.794 13 106.664 14 104.916 14 104.914 15 105.485 15 104.280 16 104.610 16 105.642 17 104.981 17 105.646 18 103.089 18 106.370 19 105.251 19 105.284 20 104.133 20 105.973 21 105.589 21 105.271 22 104.154 22 106.063 23 104.963 23 106.248 24 102.431 24 105.568 25 102.610 25 105.556 26 103.474 26 105.655 27 100.194 27 102.887 28 102.340 28 104.347 29 102.075 29 102.389 30 102.808 30 103.123 The difference is ~1.8% in average. The maximum value is 109.640 vs 113.122 The minimum value is 90.520 vs 98.713. Tested on: processor : 63 vendor_id : AuthenticAMD cpu family : 6 model : 6 model name : QEMU Virtual CPU version 2.5+ cpu MHz : 3700.204 I also can do more detailed testing using "perf" tool. -- Vlad Rezki