Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp585009ybl; Fri, 9 Aug 2019 10:25:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdZyjWk6Q1oYPK532KBhsnrfIf3bssAFSWaTjw2iX4a2F0305ZcDUbxrJZNDED26lZkomX X-Received: by 2002:a63:1f1f:: with SMTP id f31mr18115127pgf.353.1565371554067; Fri, 09 Aug 2019 10:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565371554; cv=none; d=google.com; s=arc-20160816; b=A0cTD8TRXoOvlLksdRQQrXYBAyAKKAWc9BiXXWGbha4mnKh34H/4XCfCJ2+uzrbeTe 5uHsB8bSzFCn6C3X7lWjfnqqvT0oBDMZST1b5FXKYi8FmtXzyXwqX6J8KJ9OURdiqyS2 dg3TkaPuYZETWHu3Qjj6ZIa9LCasDxxn/Hl/aDa40HAq+aWEuwoKuLQtwBFbUNdoS2jS z/TibqWROEEw9hIOMwnrpOJMvlBRs2hb5C4yC1MpJUsSJLLqUge92klHAtiBFoMzJoCX y3ZuBkE/4rwpfqj66WtoZYKvdIVKwuyLJ0Bz1orSn+OYxOAvZbpuCpWOUHHssl+9Mvs4 Y8tw== 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=EJofCy10+ue86sg1A2uKbxKGA2M2r3ITuaKGVekYLUE=; b=0FZUGoRD8GZoVedJnIgECg3D950oOAUaqImRqYweAraCFDqyogTJBBzPb2IygNW77F NWqLO6EZYkJOY042xxcnm/C+5RQ1nl+O+FFq5JJwofXRdL6AA41Fpuz0YXAi0T7GLJGq LCVEOfgxyn7jU0/zcORcCsedY6Kjp9lGrflLk+lXxMcw28OpCXIEHXEtIEL3OFSnEs51 yygdRNg8HEwsuXOmxqHwMSaXRX7GDCSx2TPCK93/h030tkWL4ZrMzhtKrax96B43V5m7 UC/yckNKnnqefS7MJe5bZs6bN8IK3Hh3+6K8hJHDAXyw6CaA5TuzzRyRnFUlQhWFVHko MlQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="H/q/ugKA"; 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 z19si10839256pfa.19.2019.08.09.10.25.39; Fri, 09 Aug 2019 10:25:54 -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="H/q/ugKA"; 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 S2436907AbfHIQB6 (ORCPT + 99 others); Fri, 9 Aug 2019 12:01:58 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42850 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfHIQB6 (ORCPT ); Fri, 9 Aug 2019 12:01:58 -0400 Received: by mail-pf1-f195.google.com with SMTP id q10so46271596pff.9 for ; Fri, 09 Aug 2019 09:01:57 -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=EJofCy10+ue86sg1A2uKbxKGA2M2r3ITuaKGVekYLUE=; b=H/q/ugKAoht1NpDQKPRvER3aJJehZtVzYkxFFgO8EZ4+hijI4cmuiYt5KDxsQ52cIb RJRdeBBzq/mfL4wSUUXMuKB3HyvtoO0/swAqi+axZ07ENli7Pag6fG+9gK/4dCReIE/3 iWobwX0iZnins6B/8VMXPaxprcydn8UfUXmJY= 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=EJofCy10+ue86sg1A2uKbxKGA2M2r3ITuaKGVekYLUE=; b=DZAniIPHZewmD2Vj7zW3x1nTQdsffNgB+a3q9/MIpVBbyxkuKRYDG34UUsnyGzZlLJ NH5bsRM5IU6u1wMiW01Wax0iAGUbd8Ss/of0wX9ne0Ny8meY4xy4V/9TLn73x/4ezdxp eXiw1a+NMAeWTUstKaUAvxhpoJu6bPSc1N87wccB63d1+OuuVpUzfOhspgtRJutthmu1 Dcga0jn4r6n9PGRnuIJnVmreNXmBs6Fum3jY26QtZxYzKfewvraEMbODv+3J0ghtmJRS I6jnWNYfTHfdFA9gJqvER4J2O0VV+6KC1BujZI2/oCNrcdRGyPggX2ihxBE9Rg0D3ufn 3H5g== X-Gm-Message-State: APjAAAXrZghcE/x3AonPvQOLyk2lQGNp7ly3LjRK45o/UXtzHeDF5Wzk yYVQh4IZGDQwnsUG7OLF6T2r4g== X-Received: by 2002:a62:e716:: with SMTP id s22mr22138885pfh.250.1565366517325; Fri, 09 Aug 2019 09:01:57 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id o95sm5331501pjb.4.2019.08.09.09.01.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 09 Aug 2019 09:01:56 -0700 (PDT) Date: Fri, 9 Aug 2019 12:01:55 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, max.byungchul.park@gmail.com, byungchul.park@lge.com, Davidlohr Bueso , Josh Triplett , kernel-team@android.com, kernel-team@lge.com, Lai Jiangshan , Mathieu Desnoyers , Rao Shoaib , rcu@vger.kernel.org, Steven Rostedt Subject: Re: [PATCH RFC v1 2/2] rcuperf: Add kfree_rcu performance Tests Message-ID: <20190809160155.GA221383@google.com> References: <20190806212041.118146-1-joel@joelfernandes.org> <20190806212041.118146-2-joel@joelfernandes.org> <20190807002915.GV28441@linux.ibm.com> <20190807102213.GD169551@google.com> <20190807175657.GF28441@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190807175657.GF28441@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 Wed, Aug 07, 2019 at 10:56:57AM -0700, Paul E. McKenney wrote: > On Wed, Aug 07, 2019 at 06:22:13AM -0400, Joel Fernandes wrote: > > On Tue, Aug 06, 2019 at 05:29:15PM -0700, Paul E. McKenney wrote: > > > On Tue, Aug 06, 2019 at 05:20:41PM -0400, Joel Fernandes (Google) wrote: > > > > This test runs kfree_rcu in a loop to measure performance of the new > > > > kfree_rcu, with and without patch. > > > > > > > > To see improvement, run with boot parameters: > > > > rcuperf.kfree_loops=2000 rcuperf.kfree_alloc_num=100 rcuperf.perf_type=kfree > > > > > > > > Without patch, test runs in 6.9 seconds. > > > > With patch, test runs in 6.1 seconds (+13% improvement) > > > > > > > > If it is desired to run the test but with the traditional (non-batched) > > > > kfree_rcu, for example to compare results, then you could pass along the > > > > rcuperf.kfree_no_batch=1 boot parameter. > > > > > > You lost me on this one. You ran two runs, with rcuperf.kfree_no_batch=1 > > > and without? Or you ran this patch both with and without the earlier > > > patch, and could have run with the patch and rcuperf.kfree_no_batch=1? > > > > I always run the rcutorture test with patch because the patch doesn't really > > do anything if rcuperf.kfree_no_batch=0. This parameter is added so that in > > the future folks can compare effect of non-batching with that of the > > batching. However, I can also remove the patch itself and run this test > > again. > > > > > If the latter, it would be good to try all three. > > > > Ok, sure. > > Very good! And please make the commit log more clear. ;-) Sure will do :) > > > > + long me = (long)arg; > > > > + struct kfree_obj **alloc_ptrs; > > > > + u64 start_time, end_time; > > > > + > > > > + VERBOSE_PERFOUT_STRING("kfree_perf_thread task started"); > > > > + set_cpus_allowed_ptr(current, cpumask_of(me % nr_cpu_ids)); > > > > + set_user_nice(current, MAX_NICE); > > > > + atomic_inc(&n_kfree_perf_thread_started); > > > > + > > > > + alloc_ptrs = (struct kfree_obj **)kmalloc(sizeof(struct kfree_obj *) * kfree_alloc_num, > > > > + GFP_KERNEL); > > > > + if (!alloc_ptrs) > > > > + return -ENOMEM; > > > > + > > > > + start_time = ktime_get_mono_fast_ns(); > > > > > > Don't you want to announce that you started here rather than above in > > > order to avoid (admittedly slight) measurement inaccuracies? > > > > I did not follow, are you referring to the measurement inaccuracy related to > > the "kfree_perf_thread task started" string print? Or, are you saying that > > ktime_get_mono_fast_ns() has to start earlier than over here? > > I am referring to the atomic_inc(). Oh yes, great catch. I will increment closer to the test's actual start. thanks! > > (I will reply to the rest of the comments below in a bit, I am going to a > > hospital now to visit a sick relative and will be back a bit later.) > > Ouch!!! I hope that goes as well as it possibly can! And please don't > neglect your relative on RCU's account!!! Thanks! it went quite well and now I am back to work ;-) - Joel