Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp606306ybv; Thu, 20 Feb 2020 04:16:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxGgHlC2ALPXw5+OpNJ3vfQuKnqDH6pbXa3WUXVrSrCZWpPwf25xOKv92l0afOEd7W8fBdL X-Received: by 2002:aca:2b04:: with SMTP id i4mr1740343oik.21.1582200965180; Thu, 20 Feb 2020 04:16:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582200965; cv=none; d=google.com; s=arc-20160816; b=pZbdiK5F4VLW2ihdURsmdhP+lihkEnyN6AMAjkYKTQYlq6jCDf2Lpd2xsEyeO1pyHi 6Ci3xCjWoCDFWNPPFsooCmXf6Dii0V5WY6UtMJcQqaJ4r6oa6n21miVwqU4ONJzty2ey /fKTvzdVj+Pm/IkrO5qBoZuddWI3x26VrkJgajK/xgBmn5i80xVfmq1b3p+ClpVnN4MB P5pDC7uxEN6L9QcQtFRsrspSRTTApbnlavTeMpI2R1PFY9uU+yMMHVq7VZqTeVDHQW7t EpEb3+sYi2UhiJ9xmxiHMzItG8if/DdRqpQBYRL0WuycVl/4dmQWPFjv5XsQtwFqkPsP hJCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wX4V1UheDmuot5IRmUUdrVTof92dfeslHq15kYKoeNs=; b=we330Sl/t+gtcpKts3FeJCR2sfomfBasgkFrUdP+dm6MOgcOna3sFoezLlwJ6DhNKK wyxGpVM01N4YwdX33/w8/aGooJHiVv08c0gwInTs0XdfQwdOdO58g6ZuExHdmbLDIhSF wezUrhsnCbIgVMK1PzbXa1ndO9fBSjp7k6o073rOSF56ofg2YIzFHOJqYUJ0LesVpdhU eYJieXDstosfSgwu+YTo2RrMPt7/m7LHkzVqJxYrDXGWEJQc8VlMrQIILQQz+Z7LMZ48 AQgy0iJail2AxA5zvWRD7QNoTfASlGTE7RmJpbmJfZ8EduUJ0a126bOfco5Of/juwkS8 g9sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PGoJQsVl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17si1704461otk.109.2020.02.20.04.15.51; Thu, 20 Feb 2020 04:16:05 -0800 (PST) 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=@linaro.org header.s=google header.b=PGoJQsVl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgBTMPf (ORCPT + 99 others); Thu, 20 Feb 2020 07:15:35 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:39698 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727553AbgBTMPf (ORCPT ); Thu, 20 Feb 2020 07:15:35 -0500 Received: by mail-lj1-f193.google.com with SMTP id o15so3977373ljg.6 for ; Thu, 20 Feb 2020 04:15:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wX4V1UheDmuot5IRmUUdrVTof92dfeslHq15kYKoeNs=; b=PGoJQsVld646DIOjw+RVmY7+5kMlwWcOBw0HxjVGVVN0tjmUE8hCeUynGEMnYyKoK3 jm66gNDG0UNlB4Zs+mFLmj3EAO1lEGTZI5DSIBuT6sNytZi9/sdxAQSCtNv1FFwx57cR dQms4/rZkhiDwKE+iUJzObH9HLid4inRr/mt+aSAfb2fg8+58iaMRc44qS3X5eUu4PaI SDpZ9P5xayOz5SE9QfK6JmZeJcaQ0NRPYw6qxXsZ0rdgTiaT3vTTfwl3FASlDYLjx/3x OScqVRl8Y4OEDUIzTgw7OAZP2I11q7jmy7oFHS3TT1M+aFRLz6/mnhFxME29MsouxiSz uzcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wX4V1UheDmuot5IRmUUdrVTof92dfeslHq15kYKoeNs=; b=rJy8OuUfYuErxgMdO0zmG1xGz3cepB7n6Lz+BXe6zTvOKFnZGwU7hgLME1wruj/IdT vCIv2i9BBroh8A1SBAz3yXE9iLBKNMeAhA8fdvrLE5bp4JhumyXFeRMCxJu8qkVFR/7O zl3qrUNDbdo/8lxSoz3MZ9DsFKE043QZ6+mvFoWmtz3IJtxZyS8FrgoSWaP7arFJqUUc 5+YcptXJfIaGHTIgq4a6A2BEzrgGaEgjcWr3AHYEU8pisj40QXDg92/oXa8/ZzxdiT3X SZ3NphFSwYoB64zhg5Y9y8p7pKj6qVa9YdcLGqQNxoSWF+LiPZDdcEuRNesCkCseujUm MkXQ== X-Gm-Message-State: APjAAAVoDh9R/Dd/Qdrb1bg8cLGgy5qg7UTg3pv2AjNvPIThMn43njmM 2JwvDdPZs4nvnG6HteEa5PrPv167xU6CRd/Hpw69hw== X-Received: by 2002:a2e:9596:: with SMTP id w22mr17671924ljh.21.1582200932224; Thu, 20 Feb 2020 04:15:32 -0800 (PST) MIME-Version: 1.0 References: <1582183784-13502-1-git-send-email-qiwuchen55@gmail.com> <20200220100915.GA14721@cqw-OptiPlex-7050> In-Reply-To: From: Vincent Guittot Date: Thu, 20 Feb 2020 13:15:20 +0100 Message-ID: Subject: Re: [PATCH] sched/fair: add !se->on_rq check before dequeue entity To: chenqiwu Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel , chenqiwu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Feb 2020 at 11:31, Vincent Guittot wrote: > > On Thu, 20 Feb 2020 at 11:09, chenqiwu wrote: > > > > On Thu, Feb 20, 2020 at 10:38:02AM +0100, Vincent Guittot wrote: > > > On Thu, 20 Feb 2020 at 08:29, wrote: > > > > > > > > From: chenqiwu > > > > > > > > We igonre checking for !se->on_rq condition before dequeue one > > > > entity from cfs rq. It must be required in case the entity has > > > > been dequeued. > > > > > > Do you have a use case that triggers this situation ? > > > > > > This is the only way to reach this situation seems to be dequeuing a > > > task on a throttled cfs_rq > > > > > Sorry, I have no use case triggers this situation. It's just found by > > reading code. > > I agree the situation you mentioned above may have a racy with > > dequeue_task_fair() in the following code path: > > __schedule > > pick_next_task_fair > > put_prev_entity > > check_cfs_rq_runtime > > throttle_cfs_rq > > dequeue_entity > > > > So this check is worth to be added for dequeue_task_fair(). > > In fact the check is already done thanks to the: if (cfs_rq_throttled(cfs_rq)) > AFAICT, there is no other way to enqueue a task on a cfs_rq for which > the group entity is not enqueued Hmm i have been too quick in my reply. I wanted to say: AFAICT, there is no other way to dequeue a task from a cfs_rq for which the group entity is not enqueued