Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4971148pxu; Wed, 21 Oct 2020 09:43:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjsqcOH7Uldn2yqRdQhH2hWki/rMwJB/vMbKY/t7jEhUm4vCWd2EDHzqeGShAN/CTEsKw1 X-Received: by 2002:a50:af21:: with SMTP id g30mr3868832edd.46.1603298628372; Wed, 21 Oct 2020 09:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603298628; cv=none; d=google.com; s=arc-20160816; b=MvQqJYRtPTwBSi5a3Tlt00mQhX3ixXWK6gWNBFe0HQupY8E3+IRnADLkuaOu7QY8kD OzpNoQrSB8N3EmmJBVuOsqivoy7CW9XXIDFVk8mSQt/dS8sm5wgrSzg/WLTWOatWq1uZ 1FRRLok5nBEWwKpDj8GqjrTjobzszbZjDOi7aE6hWBcqgH2JoM//iYgBa6wICeq72Iti Xf6y2dNL+jwz5FbXlJs8pDFXKP/lh+D5D9/diuvG3+45VK58TeBolidpSSSO+tKEPv1D 5wBlEgkliATy9AXFnuAre9RfNDtOiQKhTfQ+m2PQkUbaP6GMc+fwF5oaEKem19ASHnyv 4+Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=B6e9q2z0GzH3uZxtSerXkGeZ0/IXfy3v5gF9Wmlma8I=; b=JsPhH/2Mwd27yQQD6vP7YXFEr4Wm45cIJ7vJ0cjMv7KbtlOQQQ5KYmXKmqZDnZGfCn y355YEbo4MH8KYp+cVd2hFW9m8WwudTIz9bRDfDBkhT0MHcyno8TMRRMSlCpnPSrJsdG ot90/9Rag8XHE1jpwOlxAY1pl+1iuH3D6fp1wx1mv8X2LWvn9JcTl73S3w2zTPwU5GoJ 760c/jXYjTE5NKq1HXwFDK7gRXv3RBgS5pitUM1z9EdVck+bXV0AfcoUgZLvFs2gQaGW ldLHlJIasmK1CYutOdxz6MWNIE7WbhmZvvaeabVGprVWZ7TnDU2w6x8QAiFd8zjFOzv4 mzMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx24si4107ejb.452.2020.10.21.09.43.24; Wed, 21 Oct 2020 09:43:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409355AbgJTUHh (ORCPT + 99 others); Tue, 20 Oct 2020 16:07:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:53626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409326AbgJTUHh (ORCPT ); Tue, 20 Oct 2020 16:07:37 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 241A82225F; Tue, 20 Oct 2020 20:07:35 +0000 (UTC) Date: Tue, 20 Oct 2020 16:07:32 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira Subject: Re: sched: Reenable interrupts in do sched_yield() Message-ID: <20201020160732.5f8fc24e@oasis.local.home> In-Reply-To: <87o8kw93n4.fsf@nanos.tec.linutronix.de> References: <87r1pt7y5c.fsf@nanos.tec.linutronix.de> <20201020113830.378b4a4c@gandalf.local.home> <87o8kw93n4.fsf@nanos.tec.linutronix.de> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Oct 2020 20:02:55 +0200 Thomas Gleixner wrote: > On Tue, Oct 20 2020 at 11:38, Steven Rostedt wrote: > > On Tue, 20 Oct 2020 16:46:55 +0200 > > Thomas Gleixner wrote: > > > >> - /* > >> - * Since we are going to call schedule() anyway, there's > >> - * no need to preempt or enable interrupts: > > > > I think the above comment still makes sense, just needs to be tweeked: > > > > /* > > * Since we are going to call schedule() anyway, there's > > * no need to allow preemption after releasing the rq lock. > >> - */ > > > > Especially, since we are now enabling interrupts, which is likely to > > trigger a preemption. > > sched_preempt_enable_no_resched() still enables preemption. It just > avoids the check. And it still allows preemption when an interrupt > triggering preemption happens between sched_preempt_enable_no_resched() > and __schedule() disabling preemption/interrupts. > > So no, your new variant is just differently bogus and misleading. What I wrote wasn't exactly what I meant. What I meant to have: /* * Since we are going to call schedule() anyways, there's * no need to do the preemption check when the rq_lock is released. */ That is, to document why we have the preempt_disable() before the unlock: preempt_disable(); rq_unlock_irq(rq, &rf); sched_preempt_enable_no_resched(); -- Steve