From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311AbbCJOUo (ORCPT ); Tue, 10 Mar 2015 10:20:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbbCJOUn (ORCPT ); Tue, 10 Mar 2015 10:20:43 -0400 Date: Tue, 10 Mar 2015 14:33:37 +0000 From: Alexander Gordeev To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/10] rcu: Cleanup RCU tree initialization Message-ID: <20150310143337.GA5084@agordeev.usersys.redhat.com> References: <20150309093650.GA4767@agordeev.usersys.redhat.com> <20150309213542.GC5236@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150309213542.GC5236@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2015 at 02:35:42PM -0700, Paul E. McKenney wrote: > On Mon, Mar 09, 2015 at 09:36:52AM +0000, Alexander Gordeev wrote: > > On Mon, Mar 09, 2015 at 09:34:04AM +0100, Alexander Gordeev wrote: > > > Hi Paul, > > > > > > Here is cleanup of RCU tree initialization rebased on linux-rcu rcu/next > > > repo, as you requested. Please, note an extra patch #10 that was not > > > present in the first post. > > > > Paul, > > > > Please, ignore patch #10 for now. I missed to notice rcu_node::grpnum is > > used in tracing, so the patch is incomplete. I am not sure why trailing > > spaces in seq_printf(m, "%lx/%lx->%lx %c%c>%c %d:%d ^%d ", ....) are > > needed for, so not sure if "^%d" part should be removed (possibly with > > the traling spaces) or replaced with three spaces. > > OK, dropping this one for the moment. > > The original use of ->grpnum was for manual debugging purposes. Yes, you > can get the same information out of ->grpmask, but the number is easier > to read. And on the debugfs trace information, ->grpnum is printed, > but ->grpmask is not. > > The trailing spaces on the seq_printf() allow the rcu_node data to be > printed on a single line, while still allowing the eye to pick out > where one rcu_node structure's data ends and the next one begins. > > So here are the choices, as far as I can see: > > 1. Leave ->grpnum as is. > > 2. Remove ->grpnum, but regenerate it in print_one_rcu_state(), > for example, by counting the number of rcu_node structures > since the last ->level change. > > 3. Drop ->grpnum and also remove it from the debugfs tracing. > The reader can rely on the ->grplo and ->grphi fields to > work out where this rcu_node structure fits in, but we > lose the visual indication of any bugs in computing these > quantities. > > 4. Drop ->grpnum and replace it with ->grpmask. This seems a > bit obtuse to me. > > 5. Redesign print_one_rcu_state()'s output from scratch. > > #1 has certain advantages from a laziness viewpoint. #2 would open up > some space in the rcu_node structure, but space really isn't an issue > for that structure given that huge systems have only 257 of them and > the really small systems use Tiny RCU instead. #3 might be OK, but I > am not really convinced. #4 seems a bit ugly. I am not signing up > for #5, in part because not all that many people use RCU's debugfs > output, so I don't see the point in investing the time. > > But what did you have in mind? I probably should have marked this patch as an RFC. Given your summary #1 seems as the best choice. However, I have something else in mind, indeed. What is the reason to have 'grpnum' and 'level' as u8 while, say 'grplo' and 'grphi' - as int? IOW, do we conserve on memory for this structure or not? Thanks! > Thanx, Paul > -- Regards, Alexander Gordeev agordeev@redhat.com