Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp585938pxb; Thu, 30 Sep 2021 12:25:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh1I24MQCaoq2QSgBG9CBcIZeocH7DSQCdW6S55eutfUUC/JBzcM7Mn82RoW0bMLfWcmaF X-Received: by 2002:aa7:d64e:: with SMTP id v14mr9134832edr.381.1633029942621; Thu, 30 Sep 2021 12:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633029942; cv=none; d=google.com; s=arc-20160816; b=Q67irUXYXsgNFzE/GtUK32S/7obpiOk7Sr5PmJZGFB5Iqxdzwb+BOzxh+EZmG2Z5k6 GBsoJTneOkO9OWQ0d7OREkCcYwfnu1RycsSEIHrizZhCj943yFqfQNXasO0OKs2YcGMX sYWS1UZua5LahpqotQUKYKGdUCaqPjvSQD5ZJy35YUICBmg4vbhgRLkkJCNfTpiwwSYY EjAaK1WTAn/R7PmUqMspn+s2D/uEPOmFRZNBznv2QFPmbwbCm4Owte86sQG6WPhiKJh9 08lPoAvW4GY0qkuWqNN4WRt/aS1CuCHIuSJFo8nhp+Jjxj88Z6UbvmneP4SGzp4N4/7T tTnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DIZyZIMPtrZviYPUhA7kumW9iGvFHoustq8r9Fe4NwA=; b=sUJhr6V96gOu3uQGZ+wEJVuq279p9PXjSehxGB/lzV+5eUlejBAGUMoLh65YBfbngs j5zeQT5m8AXcxY0EkL7oEe+6Ztce3EX0kPnN+4XriHjBz4kZEtYnj16brsigA+icx21D d2474kJYgvwuVY6QT8xWbPsYSjGQAEr1FuBcjED7drjP/wJtNUjdvUSMiW+7NS+bnzRn Ho/LoGGDOmIl0zeQ8GIuiBdq7BVVcossASUwBpJSQ9bIg64rqlnc18IOpfw8M60piv+P ejRihzBvUyqCGQ3gV0ql7/ajigtA0cBk0+7A3EPCukRZHJovPLD4EtrqFNYYYGz1cHvQ IIJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=ANGhMQtO; 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 r23si2080237edp.311.2021.09.30.12.25.11; Thu, 30 Sep 2021 12:25:42 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=ANGhMQtO; 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 S232957AbhI3SfL (ORCPT + 99 others); Thu, 30 Sep 2021 14:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbhI3SfK (ORCPT ); Thu, 30 Sep 2021 14:35:10 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CBCC06176A for ; Thu, 30 Sep 2021 11:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DIZyZIMPtrZviYPUhA7kumW9iGvFHoustq8r9Fe4NwA=; b=ANGhMQtO5SO4GSrl/cTqqzLmBl 0Nkd1VPrcFhNusU0EhzJ4symEhOwmuzxUBya+LLmbzKEYIMb9uBg/XiH/HPo9EfHZXzgmrDsjjO0q SaU2/4M1hJn/zey1tKkMQ5Uy5JcxJENFj5bxtF9DKdE0+d0n99nPSbDeyFITfHBgVMALtF6XAf7qt ZGsmM2bbxienMEeIxHfKLiaUBYOB0x5fZ23Lu4kn8f8ldNlmGC9yIvJbIq1RCbmiJA2KeKbrKJUSZ FvQKPT6mSuWQquEX+o80kolB7XoqRZkkkf25LNjwQPb6KHK49m2pLGwOx3ncifpSoiY+zIU4WGJrx HOM1P7xw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mW0rt-0070Cr-3g; Thu, 30 Sep 2021 18:33:17 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 643E6981431; Thu, 30 Sep 2021 20:33:16 +0200 (CEST) Date: Thu, 30 Sep 2021 20:33:16 +0200 From: Peter Zijlstra To: Tvrtko Ursulin Cc: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tvrtko Ursulin , Ingo Molnar , Juri Lelli , Vincent Guittot Subject: Re: [RFC 1/6] sched: Add nice value change notifier Message-ID: <20210930183316.GC4323@worktop.programming.kicks-ass.net> References: <20210930171552.501553-1-tvrtko.ursulin@linux.intel.com> <20210930171552.501553-2-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210930171552.501553-2-tvrtko.ursulin@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 06:15:47PM +0100, Tvrtko Ursulin wrote: > void set_user_nice(struct task_struct *p, long nice) > { > bool queued, running; > - int old_prio; > + int old_prio, ret; > struct rq_flags rf; > struct rq *rq; > > @@ -6913,6 +6945,9 @@ void set_user_nice(struct task_struct *p, long nice) > */ > p->sched_class->prio_changed(rq, p, old_prio); > > + ret = atomic_notifier_call_chain(&user_nice_notifier_list, nice, p); > + WARN_ON_ONCE(ret != NOTIFY_DONE); > + > out_unlock: > task_rq_unlock(rq, p, &rf); > } No, we're not going to call out to exported, and potentially unbounded, functions under scheduler locks.