Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp731147ybz; Wed, 22 Apr 2020 07:02:34 -0700 (PDT) X-Google-Smtp-Source: APiQypLVY+gnfI9g48N1kho6CCBjiDLLSCamo2dOm7DSUT4NBk5Z2Hw4v3D7vuEaZdkc+CqsaurB X-Received: by 2002:a50:e0c9:: with SMTP id j9mr22923858edl.127.1587564154035; Wed, 22 Apr 2020 07:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587564154; cv=none; d=google.com; s=arc-20160816; b=eL3533ZrcPgBxuLUBVdFHdO2Wal5p23M6NT7/pKg3RnZglLRJmiC0favgORoZiXVFH lhRuzvf6xj8CZDdez/Y+GV3hnGQ9NdzhP9zndGPRM2hqRusmjWNMZU+jL8wiKd4ELuea bj2a+dx8ZTyskz/RaiZ7Vbh+40LhEEGHRHX89M68GQFf9aRFAUiWdhtZKYFpeatF3ITR D6a/zXcszkp+Zq6w3u4413DtUVojIfy04mkYooHa0k4rerl44Yqgwzqp6nSgNIn8XXXW SvNcKd5oJJyapW2WwC/XBdU7BxvM473hPHn48XCi1VaMIL4LbKg3JXIsy86fp40VY0LF uNuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=011gFebrmxXRYEXt4RNpm5unCWoPnjApvPM7qbHME3g=; b=qV3FJGIK1rjE3fYtUYKYQGXQpWV9uqiOZgOYuhOwQl/JYuYPvvtl31jhpGlOl8Doh9 ea/qlUHqukc7LBJ6xzz7vjoJIRZ5nPGA+I+fhoNEYdQuWjaNHtBq5Jfvon/QxBs2JLdq qVKOgxY2aekb9uLYdZPdlqy0R4yLzMpK2f35ri9kGHMxtk/RRdwL2Fp2ykfFh2e0tvSW c4ZNXbs2nDdiklEda1ZF8XeIIwUkGFhfqvyOeq44w8Kp8fXQq4ZPfocYZLHwCvkaFSmY thbr5R4hNafmUJGtYGPPM/SX9szdYmRdQr1F5eHkWQ7UNVUEBXnp0y6U1WSmJOC9h70Y LmoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="uNjs9/Qg"; 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 w16si3555039ejb.521.2020.04.22.07.02.08; Wed, 22 Apr 2020 07:02:34 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="uNjs9/Qg"; 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 S1726951AbgDVN7k (ORCPT + 99 others); Wed, 22 Apr 2020 09:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbgDVN7j (ORCPT ); Wed, 22 Apr 2020 09:59:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3091C03C1A9 for ; Wed, 22 Apr 2020 06:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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=011gFebrmxXRYEXt4RNpm5unCWoPnjApvPM7qbHME3g=; b=uNjs9/Qgo6yEl0AgQ/W+KtDZAg TYKY9IZkfFt1SBniPO0QmaK3+uzi6LEW3sOzC/1WfIu0J/a2VGRhuvO0YS+nA0riwcd4PJ1FzZ+PD myHh519LNmzrHULTi7CRZQX6LQzL9rQ8Si6r5XhoTQx25DYZyTP6AWCC6huGxktV1U2b86ZhgNCk0 loC6eFMwFWBcs9bJN+PMcCui5VLd7kfBWjE12b9mYn5bHAZax9+xyVo0QrJUnza9Zeu2fd1wP12ul ySoZkzJ/WVP27x85El/mLucyYEXIa7pWWNUwZ/JiCGSaCVuG7ViHPr3xYKT7MU2FDqLYYD0Um0+0c XmoVo0aw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRFuN-0005G5-FN; Wed, 22 Apr 2020 13:59:23 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 32FEC304CFD; Wed, 22 Apr 2020 15:59:21 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 16A69286A6E59; Wed, 22 Apr 2020 15:59:21 +0200 (CEST) Date: Wed, 22 Apr 2020 15:59:21 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Ingo Molnar , linux-kernel , Thomas Gleixner , Steven Rostedt , Qais Yousef , Juri Lelli , Dietmar Eggemann , Ben Segall , Mel Gorman , John Stultz Subject: Re: [PATCH 13/23] sched,ion: Convert to sched_set_normal() Message-ID: <20200422135921.GL20730@hirez.programming.kicks-ass.net> References: <20200422112719.826676174@infradead.org> <20200422112831.988065598@infradead.org> <20200422132923.GK20730@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 03:36:22PM +0200, Vincent Guittot wrote: > On Wed, 22 Apr 2020 at 15:29, Peter Zijlstra wrote: > > > > On Wed, Apr 22, 2020 at 03:21:45PM +0200, Vincent Guittot wrote: > > > On Wed, 22 Apr 2020 at 13:29, Peter Zijlstra wrote: > > > > > > > > In an attempt to take away sched_setscheduler() from modules, change > > > > this into sched_set_normal(.nice = 19). > > > > > > > > Cc: john.stultz@linaro.org > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > Reviewed-by: Ingo Molnar > > > > --- > > > > drivers/staging/android/ion/ion_heap.c | 3 --- > > > > 1 file changed, 3 deletions(-) > > > > > > > > --- a/drivers/staging/android/ion/ion_heap.c > > > > +++ b/drivers/staging/android/ion/ion_heap.c > > > > @@ -244,8 +244,6 @@ static int ion_heap_deferred_free(void * > > > > > > > > int ion_heap_init_deferred_free(struct ion_heap *heap) > > > > { > > > > - struct sched_param param = { .sched_priority = 0 }; > > > > - > > > > INIT_LIST_HEAD(&heap->free_list); > > > > init_waitqueue_head(&heap->waitqueue); > > > > heap->task = kthread_run(ion_heap_deferred_free, heap, > > > > @@ -255,7 +253,7 @@ int ion_heap_init_deferred_free(struct i > > > > __func__); > > > > return PTR_ERR_OR_ZERO(heap->task); > > > > } > > > > - sched_setscheduler(heap->task, SCHED_IDLE, ¶m); > > > > + sched_set_normal(heap->task, 19); > > > > > > Would it make sense to have a sched_set_idle(task) to enable kernel > > > setting SCHED_IDLE task ? > > > > > > SCHED_NORMAL w/ nice 19 and SCHED_IDLE tasks are not treated in the > > > same way when checking for preemption at wakeup > > > > Yeah, but does it really matter? I did indeed consider it, but got > > lazy. Is there a definite need for IDLE? > > John is the best to answer this for this driver but SCHED_IDLE will > let other tasks which might be involved in end user interaction like > on Android to run first So I don't much like SCHED_IDLE because it introduces some pretty horrible tail latencies. Consider the IDLE task holding a lock, then the lock waiter will have to wait until the task gets around to running. It's not unbounded, like a true idle-time scheduler would be, but it can still be pretty horrible. nice19 has some of that too of course, but idle has it worse, esp. also because it begs others to preempt it. I should get back to proxy execution I suppose...