Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2594618imu; Sat, 10 Nov 2018 19:10:04 -0800 (PST) X-Google-Smtp-Source: AJdET5eTHX6dsTb39deybkdbTGPFosX5GbutkDMPAwi8K96XT9n5brwbthORYBkLJPw08sbTNUFf X-Received: by 2002:a63:fa46:: with SMTP id g6mr13043178pgk.18.1541905804280; Sat, 10 Nov 2018 19:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541905804; cv=none; d=google.com; s=arc-20160816; b=K4J+cuDD+LMEljCADNVjSM9a/S9X+DownryFh1P+P26jz2p1gqvRubBH4xFM2qPHCa 7D/TpAR+YnsEAuQf8C7s76C+5Jv1RusN9lKc9P87n3OG0yKZF/+UWVBUMteAXEXu+ucS tAO0jSCjLFXScuzCpybe5f2zJeE+v7VGtNL+F4sxlKkbBwC0EWN/Vd2zYjkrwJiUs+Bf fS5VZxGb7Zr7PXmdcVT9M86cuG4IXtnHe6lCNSPy/wXusg5e4HbBJ9x+nSyHnfeG6MjG ZOVOKj6+zrwXKiuSwGOiuRFQg2WDe97BCfFqqZ+TJCjZV+fqzlVPB+9SM0lTaeu9S7mv CCZw== 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=wPD7LKfrs+pdF8VE+B6W1KWMA6VQdZKm/MLJ/tUrQ3Q=; b=xvwyewEuEboaatyb+aj84Z0kUo8kMXhdV+hAxHR24RmdUH9FyjZxI3KOTXqVSmeNjY NaKl+8Ooev5qJLT2o+R/KjX6b5eSpBFI5v6prdpWPgBD9I32ehcCVUVr3U6Z7u2HhyBn u0tkPa0RqJ43Fr34xgbHwNPVWC3/vAfsX/kr3ksCtzC2SD/aXWAZn73HOxeWUeFc8oXM nxBkhrHnAaKGAUrhH+E0UB2BZCBJK8OUNMukzd0zs8/a44L3+itmlWBh+b+qcCu4E6Ee i9U5TZSuYlCdR4zuy/exhsRcmM5m+3TWFq3aQ8QbcDQNiOm73v+oMnCSF6t+Pt+vxbHA Faaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=qARq20rv; 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 o1-v6si13662078pld.229.2018.11.10.19.09.48; Sat, 10 Nov 2018 19:10:04 -0800 (PST) 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=qARq20rv; 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 S1727304AbeKKM4j (ORCPT + 99 others); Sun, 11 Nov 2018 07:56:39 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35512 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbeKKM4j (ORCPT ); Sun, 11 Nov 2018 07:56:39 -0500 Received: by mail-pf1-f196.google.com with SMTP id v9-v6so2676148pff.2 for ; Sat, 10 Nov 2018 19:09:28 -0800 (PST) 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=wPD7LKfrs+pdF8VE+B6W1KWMA6VQdZKm/MLJ/tUrQ3Q=; b=qARq20rvk779lPgHMuIScj2tfJvBe/2sugDU5ujTUWq4Ev/4Dl1e6n3Of6dFiqmhIa 3Mz30r3pzLB7zZowBtXx0Dy6HqXc+F0BEDZTymW8waOp3HzWGTKzEuSf/LnUOLqz9h/E V/WMB+IOiwRvOgFN1MSdaH3VO+y/kHQKgavUY= 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=wPD7LKfrs+pdF8VE+B6W1KWMA6VQdZKm/MLJ/tUrQ3Q=; b=iOMrh9KIiNKI3cDbxtXeIeYyLTsXHXH0np6EzLXZsdIiXXfj84LsvfnHjcnxNT9oh2 ih5aNqcyDjquetJCYwRUjmcIJy5dNtwN96bdczRgSxRFuikGEFjW+R9YvbMaj6R19IqB pdDD/Il6EvannwAmQs9bybvGh7Zpvjx2ulrn2jZmlLMMk8Sm9LYLw98T2C3goTMo0hDJ B6M//UrFTczGJc6cVEuNqaXgVJ4SHUj3E2J5tmb7O1UqjVpwmAHdAsU/8QArLn53TzKM lfc7G8dscRor15cWGveHWUT5FdXOZQ8Iowb06YUVNVXdFzdyJ3dPUJZpY46xvXcw+dfZ bM2w== X-Gm-Message-State: AGRZ1gIja6Y4g1djLtH5/N88BFHlRxetmDpoww/I2vQTD8B53JAIliGn CcLle2tAw+BajFIpep4hYHr6sBS2Vek= X-Received: by 2002:a62:3a54:: with SMTP id h81-v6mr15032530pfa.119.1541905767208; Sat, 10 Nov 2018 19:09:27 -0800 (PST) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id l3sm11358337pga.92.2018.11.10.19.09.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 19:09:26 -0800 (PST) Date: Sat, 10 Nov 2018 19:09:25 -0800 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com Subject: Re: dyntick-idle CPU and node's qsmask Message-ID: <20181111030925.GA182908@google.com> References: <20181110214659.GA96924@google.com> <20181110230436.GL4170@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181110230436.GL4170@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 Sat, Nov 10, 2018 at 03:04:36PM -0800, Paul E. McKenney wrote: > On Sat, Nov 10, 2018 at 01:46:59PM -0800, Joel Fernandes wrote: > > Hi Paul and everyone, > > > > I was tracing/studying the RCU code today in paul/dev branch and noticed that > > for dyntick-idle CPUs, the RCU GP thread is clearing the rnp->qsmask > > corresponding to the leaf node for the idle CPU, and reporting a QS on their > > behalf. > > > > rcu_sched-10 [003] 40.008039: rcu_fqs: rcu_sched 792 0 dti > > rcu_sched-10 [003] 40.008039: rcu_fqs: rcu_sched 801 2 dti > > rcu_sched-10 [003] 40.008041: rcu_quiescent_state_report: rcu_sched 805 5>0 0 0 3 0 > > > > That's all good but I was wondering if we can do better for the idle CPUs if > > we can some how not set the qsmask of the node in the first place. Then no > > reporting would be needed of quiescent state is needed for idle CPUs right? > > And we would also not need to acquire the rnp lock I think. > > > > At least for a single node tree RCU system, it seems that would avoid needing > > to acquire the lock without complications. Anyway let me know your thoughts > > and happy to discuss this at the hallways of the LPC as well for folks > > attending :) > > We could, but that would require consulting the rcu_data structure for > each CPU while initializing the grace period, thus increasing the number > of cache misses during grace-period initialization and also shortly after > for any non-idle CPUs. This seems backwards on busy systems where each When I traced, it appears to me that rcu_data structure of a remote CPU was being consulted anyway by the rcu_sched thread. So it seems like such cache miss would happen anyway whether it is during grace-period initialization or during the fqs stage? I guess I'm trying to say, the consultation of remote CPU's rcu_data happens anyway. > CPU will with high probability report its own quiescent state before three > jiffies pass, in which case the cache misses on the rcu_data structures > would be wasted motion. If all the CPUs are busy and reporting their QS themselves, then I think the qsmask is likely 0 so then rcu_implicit_dynticks_qs (called from force_qs_rnp) wouldn't be called and so there would no cache misses on rcu_data right? > Now, this does increase overhead on mostly idle systems, but the theory > is that mostly idle systems are most able to absorb this extra overhead. Yes. Could we use rcuperf to check the impact of such change? Anyway it was just an idea that popped up when I was going through traces :) Thanks for the discussion and happy to discuss further or try out anything. - Joel