Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp201539ybl; Tue, 20 Aug 2019 18:19:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqGpoBIuwBWneGDRo/3jEZIw/wYlsazEUuc320n7OIwgw7R0xgQ35EeX44080CkodNsdSb X-Received: by 2002:a62:584:: with SMTP id 126mr33293452pff.73.1566350389638; Tue, 20 Aug 2019 18:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566350389; cv=none; d=google.com; s=arc-20160816; b=OrhHG8M/m7Hx9EZz4ybnS0YC6YgAz9/stHN+zeGiDYfG61Wbp7PGfoCAZEMMZHxxPr 4Zwn8/ntrDzFGYmT4qqIID+bQFyMbQZ0GcZh1lH5ix4ArEY9eYux9w+0yA0p3cSb6O3f k6GkIc5vCNgWGSVbGm3LTTQkIkl2vOVPq/7Fdl5WDLiH6FZevBx1ufpndMBd+BYoNzTY 2UXPO/F7z3TgADsHWiEhqXj9cicMX5gnpd4HMfoZQbvvi6Ts1W040jSA+HjHcDcifi43 kuU6JRFA6dbqj/z3Ad0yj0kB2GKWt2gu9gZvwMwHcMaWZigUv9cv2+SihtkNGZYYW677 fKyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Pbppln3FnKyqVlRJygT2B6SgzOfnHFv1Prefdnvt17A=; b=aDBWkSqGOS2RrZaiD//MPHMcp4PeGMRBiwEJL3HJM46NRQ378WbS9pq3kurbp0uPrf D5fI0h/9eHkLIAB+ZZkxsJokdjuo6Zo4T/XiH1UN02p1+vfN597Kqw9fGM/ScQrF4l2p SfBcfnCJQLRUtkwifkdRLU199VjfG2mtHXHkysCiOn/TQNnHXBJG6fL8s8kIJEVCZaN8 Dn/vs0UOkaQmph8j55sTbG1XqE00W8CDmIW1+r8p/0O7IKRnGvjouNQmpg4HQE+EeDNF zrJaNBilJ3W6ivREpnXmvnV3uvWu4PZ8jmbH9nFBynb5l+9lBfyhQhtwFHJ95KeSJX06 watQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=QwineO+6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si1168098pjz.58.2019.08.20.18.19.22; Tue, 20 Aug 2019 18:19:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=QwineO+6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726807AbfHUAwN (ORCPT + 99 others); Tue, 20 Aug 2019 20:52:13 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40415 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726215AbfHUAwM (ORCPT ); Tue, 20 Aug 2019 20:52:12 -0400 Received: by mail-pl1-f194.google.com with SMTP id h3so341519pls.7 for ; Tue, 20 Aug 2019 17:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Pbppln3FnKyqVlRJygT2B6SgzOfnHFv1Prefdnvt17A=; b=QwineO+6eezEllrI2gW6kup6pia36NF654QzQuGX/N5BE6w7MCw1g62W9XyixJQW5r zXfckRM4/p+rWVYgvPAz0TYRi+ngrJjmba7b1TM/KqpVbzscyjiXlEsW1SbAJQm9eANZ qhWfFa/8/1BawUIvtNIxmlJdwvmr3VMDa6ygg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Pbppln3FnKyqVlRJygT2B6SgzOfnHFv1Prefdnvt17A=; b=L7qSd8X0fDVZGgwfhsuRcv1XX+bi4pwhJWOWL22dPyzkShLgOiwXjPPc6oYxm4qQM1 QMWgyR7xQPkKPVC3zo7HBTnrhsrRRioJGpoJIiz0USmpiA7lvJPo3jzp9eGZERWk0LSz okuyxFMd6Utf//rbEb12zeFvFkn9XI3qjtWVL/RW2MfVC6lHXjIpF964CLGt6xZbAFPZ zn3bUGFxdvcBVP9f+c2dFQlfawtsYfvBgEacN/AxhuJxooLyTBvBzlyr3C/ucVhRFIt6 qOk81HP33EwHA1WTaxQbavEOincBdoEyFV10JcfZPImIhWv2MO4phf8ayV8yFnXbcDRg mX5g== X-Gm-Message-State: APjAAAWiZ0XyUBh8eHkA700qGXgw9gORSW9SDX+9YZ5NfHlGAP5Ca80G /LtsdDflY4R6LV7msH6AcdaSDQ== X-Received: by 2002:a17:902:1123:: with SMTP id d32mr226220pla.218.1566348731838; Tue, 20 Aug 2019 17:52:11 -0700 (PDT) Received: from localhost ([172.19.216.18]) by smtp.gmail.com with ESMTPSA id t9sm1096167pji.18.2019.08.20.17.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 17:52:11 -0700 (PDT) Date: Tue, 20 Aug 2019 20:51:54 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, byungchul.park@lge.com, Davidlohr Bueso , Josh Triplett , kernel-team@android.com, kernel-team@lge.com, Lai Jiangshan , Mathieu Desnoyers , max.byungchul.park@gmail.com, Rao Shoaib , rcu@vger.kernel.org, Steven Rostedt Subject: Re: [PATCH v4 2/2] rcuperf: Add kfree_rcu() performance Tests Message-ID: <20190821005154.GA27466@google.com> References: <20190814160411.58591-1-joel@joelfernandes.org> <20190814160411.58591-2-joel@joelfernandes.org> <20190814225850.GZ28441@linux.ibm.com> <20190819193327.GF117548@google.com> <20190819222330.GH28441@linux.ibm.com> <20190819235123.GA185164@google.com> <20190820025056.GL28441@linux.ibm.com> <20190821002705.GA212946@google.com> <20190821003132.GA25611@google.com> <20190821004436.GB28441@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190821004436.GB28441@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 05:44:36PM -0700, Paul E. McKenney wrote: > On Tue, Aug 20, 2019 at 08:31:32PM -0400, Joel Fernandes wrote: > > On Tue, Aug 20, 2019 at 08:27:05PM -0400, Joel Fernandes wrote: > > [snip] > > > > > > Or is the idea to time the kfree_rcu() loop separately? (I don't see > > > > > > any such separate timing, though.) > > > > > > > > > > The kmalloc() times are included within the kfree loop. The timing of > > > > > kfree_rcu() is not separate in my patch. > > > > > > > > You lost me on this one. What happens when you just interleave the > > > > kmalloc() and kfree_rcu(), without looping, compared to the looping > > > > above? Does this get more expensive? Cheaper? More vulnerable to OOM? > > > > Something else? > > > > > > You mean pairing a single kmalloc() with a single kfree_rcu() and doing this > > > several times? The results are very similar to doing kfree_alloc_num > > > kmalloc()s, then do kfree_alloc_num kfree_rcu()s; and repeat the whole thing > > > kfree_loops times (as done by this rcuperf patch we are reviewing). > > > > > > Following are some numbers. One change is the case where we are not at all > > > batching does seem to complete even faster when we fully interleave kmalloc() > > > with kfree() while the case of batching in the same scenario completes at the > > > same time as did the "not fully interleaved" scenario. However, the grace > > > period reduction improvements and the chances of OOM'ing are pretty much the > > > same in either case. > > [snip] > > > Not fully interleaved: do kfree_alloc_num kmallocs, then do kfree_alloc_num kfree_rcu()s. And repeat this kfree_loops times. > > > ======================= > > > (1) Batching > > > rcuperf.kfree_loops=20000 rcuperf.kfree_alloc_num=8000 rcuperf.kfree_no_batch=0 rcuperf.kfree_rcu_test=1 > > > > > > root@(none):/# free -m > > > total used free shared buff/cache available > > > Mem: 977 251 686 0 39 684 > > > Swap: 0 0 0 > > > > > > [ 15.574402] Total time taken by all kfree'ers: 14185970787 ns, loops: 20000, batches: 1548 > > > > > > (2) No Batching > > > rcuperf.kfree_loops=20000 rcuperf.kfree_alloc_num=8000 rcuperf.kfree_no_batch=1 rcuperf.kfree_rcu_test=1 > > > > > > root@(none):/# free -m > > > total used free shared buff/cache available > > > Mem: 977 82 855 0 39 853 > > > Swap: 0 0 0 > > > > > > [ 13.724554] Total time taken by all kfree'ers: 12246217291 ns, loops: 20000, batches: 7262 > > > > And the diff for changing the test to do this case is as follows (I don't > > plan to fold this diff in, since I feel the existing test suffices and > > results are similar): > > But why not? It does look to be a nice simplification, after all. That's true. Ok, I'll squash it in. thanks! thanks, - Joel [snip]