Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6918838ybi; Mon, 8 Jul 2019 10:51:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCFNPKNMbjg1hle1js+c8IxyJXad3G25DE8og1TJ+o4TccXCsC8E/+pnn2cysg6CQXbg91 X-Received: by 2002:a17:902:4501:: with SMTP id m1mr26713664pld.111.1562608312538; Mon, 08 Jul 2019 10:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562608312; cv=none; d=google.com; s=arc-20160816; b=VouAdAmrFpffvC9bqDjDKGCn/vQXCSg/RWhXhlcAII7x2QTlotY3hdZ/DKQu4zMAqh KDLhBZDA9MqpjAQqJNUWuID+aYtvCnTRBE+ZFZsD5Az4mIuSnT3V/UFUl+B+6f/txpRh iZnfR1IQ2lzeNxAxEpFAYT4JM2pZkyW9Gs2C0x4Nl2fJfHsq327sjttCVNZDm1eRDCoU CTOc858bYKJL0HnKvhWMeXZvj+CgCs3Fkl1/yVMeTnsBn5aFBP5n/8pILhDI6yWxwsqI bv2BjqtAFXVUG+E7KZTgeIxSCphcRxcP6bZC8zl6QsRhAf/zuKXEjpTsEIEkdOu2lYJp Z/RA== 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=xEfBrs0GhPems//ZFf52Fo4j6AMBzVKhWRp8eHZnqyk=; b=jnIg+OgrO8ONXVF6v82TpB/ewCnqY5UAYvhGG3tNvc/orJyz83k5T5POCY2FdJhWm/ SasC9OdsyKgkdjQ0gmU8PRBw4UgaJEmvZkz2fmN3jk2kUzRHXVVrMN5IsFo7xP4g3TJU icl7FwQq5RZih6uWCW+Z5HdO98e47/5aqF108k8eQ9umfE5sN6JRXtDghnHrNIyRVEvZ orcatHK4C2GZ9oLyBqXEJ5p+Xcc3UQyHRQ8JBIBNCtagez2UBbOl3MdoggGEdgbKHaWE ZXk/VJf/qdswfPQLpO8Bc/DW/MvD8T9RkZmUSipiyC4/g3Ztu+QJAGddZelRvVpSzOEc PPWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Iru3nkI7; 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 v189si18751500pgd.289.2019.07.08.10.51.37; Mon, 08 Jul 2019 10:51:52 -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=Iru3nkI7; 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 S1731200AbfGHNEC (ORCPT + 99 others); Mon, 8 Jul 2019 09:04:02 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34850 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728800AbfGHNEC (ORCPT ); Mon, 8 Jul 2019 09:04:02 -0400 Received: by mail-pl1-f194.google.com with SMTP id w24so8248159plp.2 for ; Mon, 08 Jul 2019 06:04:01 -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=xEfBrs0GhPems//ZFf52Fo4j6AMBzVKhWRp8eHZnqyk=; b=Iru3nkI7DdRqXxzZ+0XkeP7Rnohck3RuZS81SLlMzIsYYgLTBoTzwIvINF7hVsPs2N ZwzM7OEIf7qiFCssBC7h5Y92COfsEJU/Y8hza+5nefr1z4cysRWWIJqs37R6Chv25xK5 y45rh8Yr+SnYzmyYUJfPnrszcA3W2iX8piLwk= 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=xEfBrs0GhPems//ZFf52Fo4j6AMBzVKhWRp8eHZnqyk=; b=lHtDqolakUbY3JaZuriaRDM0qv8m61G3BAO7cSzbgeniIhys1Rz3rQtMZZ0wkELrVf IVIWYQgOMK8yXBy0Dah0bGeW9+5QLQlFK1DmuNngsLQegEwOWZt6fCHXVMUfIR7twWPb OwzgIf8Ku/CwYObimCzZul6ouch/DV7uOJ+qjjQVuIlzinxnOSGlMjLD3tjLM7fD2O4z pXeosME0ryBEuS7kYTtANI/KN9QLnFSNc38BgJHdT/IIikYRovHlvCupRtzfC1EuNlgm IfXrhOd7oUnI6OYKUW+UGrw+OJhtVSBpkRlFbYYLeJxIzL1Ap0hr9kZM9bLy9RvUp2s1 XW3A== X-Gm-Message-State: APjAAAVcdrVdL5OoVR0U11Kuv45kqGzIivjYXa4kUUztCFMyaK0FKQ9f +gCLf0X2h3GGXzsmXPdwPA93QQ== X-Received: by 2002:a17:902:1125:: with SMTP id d34mr24723603pla.40.1562591041295; Mon, 08 Jul 2019 06:04:01 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id s66sm22941893pgs.39.2019.07.08.06.03.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 06:04:00 -0700 (PDT) Date: Mon, 8 Jul 2019 09:03:59 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: Byungchul Park , josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [PATCH] rcu: Make jiffies_till_sched_qs writable Message-ID: <20190708130359.GA42888@google.com> References: <1562565609-12482-1-git-send-email-byungchul.park@lge.com> <20190708125013.GG26519@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190708125013.GG26519@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 Good morning! On Mon, Jul 08, 2019 at 05:50:13AM -0700, Paul E. McKenney wrote: > On Mon, Jul 08, 2019 at 03:00:09PM +0900, Byungchul Park wrote: > > jiffies_till_sched_qs is useless if it's readonly as it is used to set > > jiffies_to_sched_qs with its value regardless of first/next fqs jiffies. > > And it should be applied immediately on change through sysfs. It is interesting it can be setup at boot time, but not at runtime. I think this can be mentioned in the change log that it is not really "read-only", because it is something that can be dynamically changed as a kernel boot parameter. > Actually, the intent was to only allow this to be changed at boot time. > Of course, if there is now a good reason to adjust it, it needs > to be adjustable. So what situation is making you want to change > jiffies_till_sched_qs at runtime? To what values is it proving useful > to adjust it? What (if any) relationships between this timeout and the > various other RCU timeouts need to be maintained? What changes to > rcutorture should be applied in order to test the ability to change > this at runtime? I am also interested in the context, are you changing it at runtime for experimentation? I recently was doing some performance experiments and it is quite interesting how reducing this value can shorten grace period times :) Joel > Thanx, Paul > > > The function for setting jiffies_to_sched_qs, > > adjust_jiffies_till_sched_qs() will be called only if > > the value from sysfs != ULONG_MAX. And the value won't be adjusted > > unlike first/next fqs jiffies. > > > > While at it, changed the positions of two module_param()s downward. > > > > Signed-off-by: Byungchul Park > > --- > > kernel/rcu/tree.c | 22 ++++++++++++++++++++-- > > 1 file changed, 20 insertions(+), 2 deletions(-) > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index a2f8ba2..a28e2fe 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -422,9 +422,7 @@ static int rcu_is_cpu_rrupt_from_idle(void) > > * quiescent-state help from rcu_note_context_switch(). > > */ > > static ulong jiffies_till_sched_qs = ULONG_MAX; > > -module_param(jiffies_till_sched_qs, ulong, 0444); > > static ulong jiffies_to_sched_qs; /* See adjust_jiffies_till_sched_qs(). */ > > -module_param(jiffies_to_sched_qs, ulong, 0444); /* Display only! */ > > > > /* > > * Make sure that we give the grace-period kthread time to detect any > > @@ -450,6 +448,18 @@ static void adjust_jiffies_till_sched_qs(void) > > WRITE_ONCE(jiffies_to_sched_qs, j); > > } > > > > +static int param_set_sched_qs_jiffies(const char *val, const struct kernel_param *kp) > > +{ > > + ulong j; > > + int ret = kstrtoul(val, 0, &j); > > + > > + if (!ret && j != ULONG_MAX) { > > + WRITE_ONCE(*(ulong *)kp->arg, j); > > + adjust_jiffies_till_sched_qs(); > > + } > > + return ret; > > +} > > + > > static int param_set_first_fqs_jiffies(const char *val, const struct kernel_param *kp) > > { > > ulong j; > > @@ -474,6 +484,11 @@ static int param_set_next_fqs_jiffies(const char *val, const struct kernel_param > > return ret; > > } > > > > +static struct kernel_param_ops sched_qs_jiffies_ops = { > > + .set = param_set_sched_qs_jiffies, > > + .get = param_get_ulong, > > +}; > > + > > static struct kernel_param_ops first_fqs_jiffies_ops = { > > .set = param_set_first_fqs_jiffies, > > .get = param_get_ulong, > > @@ -484,8 +499,11 @@ static int param_set_next_fqs_jiffies(const char *val, const struct kernel_param > > .get = param_get_ulong, > > }; > > > > +module_param_cb(jiffies_till_sched_qs, &sched_qs_jiffies_ops, &jiffies_till_sched_qs, 0644); > > module_param_cb(jiffies_till_first_fqs, &first_fqs_jiffies_ops, &jiffies_till_first_fqs, 0644); > > module_param_cb(jiffies_till_next_fqs, &next_fqs_jiffies_ops, &jiffies_till_next_fqs, 0644); > > + > > +module_param(jiffies_to_sched_qs, ulong, 0444); /* Display only! */ > > module_param(rcu_kick_kthreads, bool, 0644); > > > > static void force_qs_rnp(int (*f)(struct rcu_data *rdp)); > > -- > > 1.9.1 > > >