From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URG_BIZ,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E83A3C6778C for ; Fri, 6 Jul 2018 17:09:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E9DB214C5 for ; Fri, 6 Jul 2018 17:09:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E9DB214C5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933769AbeGFRJm (ORCPT ); Fri, 6 Jul 2018 13:09:42 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:35478 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933275AbeGFRJj (ORCPT ); Fri, 6 Jul 2018 13:09:39 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w66H3htT123321 for ; Fri, 6 Jul 2018 13:09:38 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k296qrjce-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Jul 2018 13:09:38 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jul 2018 13:09:38 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 6 Jul 2018 13:09:35 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w66H9YAP9109892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 6 Jul 2018 17:09:34 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6F06B2068; Fri, 6 Jul 2018 13:09:13 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9279B2064; Fri, 6 Jul 2018 13:09:13 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 6 Jul 2018 13:09:13 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 2413116CA5D3; Fri, 6 Jul 2018 10:11:50 -0700 (PDT) Date: Fri, 6 Jul 2018 10:11:50 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: David Woodhouse , mhillenb@amazon.de, linux-kernel Subject: Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested Reply-To: paulmck@linux.vnet.ibm.com References: <20180706162905.GZ2476@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180706162905.GZ2476@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18070617-0040-0000-0000-0000044B2AC5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009320; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01057468; UDB=6.00542549; IPR=6.00835389; MB=3.00022029; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-06 17:09:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070617-0041-0000-0000-000008514AB3 Message-Id: <20180706171150.GI3593@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-06_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=920 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807060190 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 06, 2018 at 06:29:05PM +0200, Peter Zijlstra wrote: > On Fri, Jul 06, 2018 at 03:53:30PM +0100, David Woodhouse wrote: > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index e4d4e60..89f5814 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1616,7 +1616,8 @@ static inline int spin_needbreak(spinlock_t *lock) > > > > static __always_inline bool need_resched(void) > > { > > - return unlikely(tif_need_resched()); > > + return unlikely(tif_need_resched()) || > > + rcu_urgent_qs_requested(); > > } > > Instead of making need_resched() touch two cachelines, I think I would > prefer adding resched_cpu() to rcu_request_urgent_qs_task(). I used to do something like this, but decided that whacking each holdout CPU over the head ten times a second was a bit much. > The preempt state is alread a bit complicated and shadowed in the > preempt_count (on some architectures) adding additional bits to it like > this is just asking for trouble. How about a separate need_resched_rcu() that includes the extra cache miss? Or open-coding the rcu_urgent_qs_requested()? Thanx, Paul