Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2443064ybl; Thu, 29 Aug 2019 08:14:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7vyIBlfKjoscRmPIB3ix/4x5/rXQH/P3LGpixnsJXk5J0xd5r6B+Bcex296bmUKcVo5rl X-Received: by 2002:a17:90a:ec07:: with SMTP id l7mr10297194pjy.39.1567091687260; Thu, 29 Aug 2019 08:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567091687; cv=none; d=google.com; s=arc-20160816; b=cmU4nfMBr49HeYklGdpYjFaLCNH+TLaLhQzk9re59yYStYyLM/ZeLZfKW+XCkbiyXV eCaRJeUXvB9XGmC1WlC3g/O/NsCmi8+5FJPog9twaW7Q5SqbyE5NxXbY0tDgqgtusVtW pCMLCrxeMP7xJC5sqGEk+DE4sdFCQOWegt0XsqeRA7ZuLUnrxX5K1Mrmk6p6ONIGGZ6G kt3kwbjs79HwsikGjTy02RkMO6sySrV832amZXk5zqbw3SDjTtGtOssVwAd7q4lbBW3y tt6fZGUmIePdhaYDES9hwGnP03ZH3YxTR19GVSyJDWl1yIIxjlp+B35QrwS9DriBxuNh P66A== 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=oSA8ov+ZxGfOeyM4FKYs2Nid/DuJCRG23ZrZB7IrRWk=; b=dJCVOt8LFNoMe8DvKvl1IaiSk49+LE8S7Dqldx37+uTSkCbYKFdcgoNMXQOfkvCW58 ciyROI/224nJQWWOkmHfpGiJCdsaqtboy0bYOiaKhBTN48nGzeo+SGJlLICA3OAUEcCN LF7OnGZ42rVxRZmVR2zvhEhP4/fNoL0Isurmn/uozMvKI8duQu86/eKNkKbUZikO946w 4O0Dkia/GYX7aFH9bF7HtmlbRHa8S7VdMObBta2wtA7q+vtemCzYyBwzPhk5Jo0HjBNO +TA+kh7nl0EVMBmys/czr22co/B6z0JqUoFu9gMiWaGWMmtTsQiV+rpayQVoq5JRuigj XTXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=kIyNWK9f; 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 h185si2214005pge.199.2019.08.29.08.14.30; Thu, 29 Aug 2019 08:14:47 -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=kIyNWK9f; 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 S1727958AbfH2PN2 (ORCPT + 99 others); Thu, 29 Aug 2019 11:13:28 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36551 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727910AbfH2PN1 (ORCPT ); Thu, 29 Aug 2019 11:13:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id l21so1759032pgm.3 for ; Thu, 29 Aug 2019 08:13:27 -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=oSA8ov+ZxGfOeyM4FKYs2Nid/DuJCRG23ZrZB7IrRWk=; b=kIyNWK9fUMDTw74XfJRQvKDDXXMI+4+u8Mb3UgLkbeO9AtQutIbyr3q7ZYrPTqU/7l dvNmKn/90EnJpoT+sxpfrKnAwyFTz1VTXzhjPusaW2wFnTS0q8oGRhjn7sq48aJt1HEa nG2bRVYSFr61hhnkqIXTOH6mRObiPBD3yBr5o= 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=oSA8ov+ZxGfOeyM4FKYs2Nid/DuJCRG23ZrZB7IrRWk=; b=Db+TWAlCFL9yuJh+AJleJLWxfx6uPt3cj3qrdS1ovfijugkTLHmxTQGIl44aN15PDi brFBDzWOevUtyqV+MiKf1cwE2y7vGGKZN6T81tdcB5gNLSGxuwEt288fH+YGDREnl3td eY6f72zOawWIDL7n3uwxMYHB86KhGdblHboYYkOjXJ8/vTqpWvvOKpfHEdrICFr5A5ro jKSDbUP6Z8QiNil7RuSD1dHW+lgt32A8aYr46vX2WymdZLPFU3yE3LxbypoBrdQebp2D XDHboN8pR7ICdQ7xUahx7VqUSy4xSDPbGuPtf+C5y21mcUxlrOWRweuIv9EAC7+iHdjI Fbag== X-Gm-Message-State: APjAAAWZjGyDzjL9PglVoYZ0ZnDtjtOR5eqwisBDxz0mraZP2YWzpmE8 P4TxA8Z+xs7zA470rLVTkctbEA== X-Received: by 2002:a65:48c3:: with SMTP id o3mr8733095pgs.372.1567091606893; Thu, 29 Aug 2019 08:13:26 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id x11sm7454257pfj.83.2019.08.29.08.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 08:13:26 -0700 (PDT) Date: Thu, 29 Aug 2019 11:13:25 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Frederic Weisbecker , Jonathan Corbet , Josh Triplett , kernel-team@android.com, Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers , Mauro Carvalho Chehab , rcu@vger.kernel.org, Steven Rostedt Subject: Re: [RFC v1 2/2] rcu/tree: Remove dynticks_nmi_nesting counter Message-ID: <20190829151325.GF63638@google.com> References: <20190828202330.GS26530@linux.ibm.com> <20190828210525.GB75931@google.com> <20190828211904.GX26530@linux.ibm.com> <20190828214241.GD75931@google.com> <20190828220108.GC26530@linux.ibm.com> <20190828221444.GA100789@google.com> <20190828231247.GE26530@linux.ibm.com> <20190829015155.GB100789@google.com> <20190829034336.GD4125@linux.ibm.com> <20190829144355.GE63638@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829144355.GE63638@google.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 Thu, Aug 29, 2019 at 10:43:55AM -0400, Joel Fernandes wrote: > On Wed, Aug 28, 2019 at 08:43:36PM -0700, Paul E. McKenney wrote: > [snip] > > > > > > This change is not fixing a bug, so there is no need for an emergency fix, > > > > > > and thus no point in additional churn. I understand that it is a bit > > > > > > annoying to code and test something and have your friendly maintainer say > > > > > > "sorry, wrong rocks", and the reason that I understand this is that I do > > > > > > that to myself rather often. > > > > > > > > > > The motivation for me for this change is to avoid future bugs such as with > > > > > the following patch where "== 2" did not take the force write of > > > > > DYNTICK_IRQ_NONIDLE into account: > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?h=dev&id=13c4b07593977d9288e5d0c21c89d9ba27e2ea1f > > > > > > > > Yes, the current code does need some simplification. > > > > > > > > > I still don't see it as pointless churn, it is also a maintenance cost in its > > > > > current form and the simplification is worth it IMHO both from a readability, > > > > > and maintenance stand point. > > > > > > > > > > I still don't see what's technically wrong with the patch. I could perhaps > > > > > add the above "== 2" point in the patch? > > > > > > > > I don't know of a crash or splat your patch would cause, if that is > > > > your question. But that is also true of the current code, so the point > > > > is simplification, not bug fixing. And from what I can see, there is an > > > > opportunity to simplify quite a bit further. And with something like > > > > RCU, further simplification is worth -serious- consideration. > > > > > > > > > We could also discuss f2f at LPC to see if we can agree about it? > > > > > > > > That might make a lot of sense. > > > > > > Sure. I am up for a further redesign / simplification. I will think more > > > about your suggestions and can also further discuss at LPC. > > > > One question that might (or might not) help: Given the compound counter, > > where the low-order hex digit indicates whether the corresponding CPU > > is running in a non-idle kernel task and the rest of the hex digits > > indicate the NMI-style nesting counter shifted up by four bits, what > > could rcu_is_cpu_rrupt_from_idle() be reduced to? > > > > > And this patch is on LKML archives and is not going anywhere so there's no > > > rush I guess ;-) > > > > True enough! ;-) > > Paul, do we also nuke rcu_eqs_special_set()? Currently I don't see anyone > using it. And also remove the bottom most bit of dynticks? > > Also what happens if a TLB flush broadcast is needed? Do we IPI nohz or idle > CPUs are the moment? > > All of this was introduced in: > b8c17e6664c4 ("rcu: Maintain special bits at bottom of ->dynticks counter") Paul, also what what happens in the following scenario: CPU0 CPU1 A syscall causes rcu_eqs_exit() rcu_read_lock(); ---> FQS loop waiting on dyntick_snap usermode-upcall entry -->causes rcu_eqs_enter(); usermode-upcall exit -->causes rcu_eqs_exit(); ---> FQS loop sees dyntick snap increment and declares CPU0 is in a QS state before the rcu_read_unlock! rcu_read_unlock(); --- Does the context tracking not call rcu_user_enter() in this case, or did I really miss something? thanks, - Joel