Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp709141pxb; Thu, 26 Aug 2021 12:40:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmnEojl9H3JzqRSvPdfq1BYmnbcnudJrn0uAuTEYVQmkdgw+P07smRCHoZ/ODyYb5hc/GE X-Received: by 2002:a05:6402:2158:: with SMTP id bq24mr6032186edb.8.1630006846490; Thu, 26 Aug 2021 12:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630006846; cv=none; d=google.com; s=arc-20160816; b=iHJI710K4JBqqdadC16J9KzLkShDsO1PRDUszjVQ3hXOZ7l9cABlMFKrOY+Yb/qgFm mI/Baq7YlUyRF9MvYkvlzYIPaU0I99u7WAlW3hK0MPweMmMjFVcO+/nXA1HC7H8rK+IG qg4i4NX8UF0vx1bldNF8YYU0kb8b2yFXPc8PcR++SGjFHMOWs9SdKiwzCEYQY1JQU8gF QJWy5jMBQQZIuz9g5pPIXcRtAvd5hJ78iul2+lxeloxBjXGPEGN+pLv30vF7g+kHIsZH aT+IUkUnLA4WkO2c5QcodlyqNikWkpTTO9qvTVO/yBewk2RgaC44Ujacy1NOkcnajwGH 3EWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=W/9AWcYJSH4xE7X6sIVTqAAgx4sldVO3IC3jE306c0o=; b=Z+X2MAmvXfscdVia7bpz9L1Vo6nho5sJU43NDXfJMzPRYS/xhUyNS+yiWKRWCkP/2u AkZYugMR6jYw3EsJfmrshkFiBsqSD93xOc+RWqi86rvl3LkMAO4SGnQAqdhh3h+T83bw 0JPihY1DxEIGA1admapBRrTs9s6KY9pqjlZrl2L4fWbO2R6mLxevhv2TE8M5jsuqBWnd 5X3FIJCCtMdLEBGC9zDgYaWAjX/7LzjZDt5Z22dIIWKcXZDj7IhKOZqUWa+ayHjl2G4H SE9B5Ro7MpChNn1s6PeQ7u2myMuNerZ5dfg6NRDUGTYNozR7LVHixaYP3m6GyIDTI5OV A1bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="jz0Wvb/M"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si3927120eds.206.2021.08.26.12.40.16; Thu, 26 Aug 2021 12:40:46 -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=@linutronix.de header.s=2020 header.b="jz0Wvb/M"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243431AbhHZTjN (ORCPT + 99 others); Thu, 26 Aug 2021 15:39:13 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34172 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243480AbhHZTjM (ORCPT ); Thu, 26 Aug 2021 15:39:12 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1630006698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W/9AWcYJSH4xE7X6sIVTqAAgx4sldVO3IC3jE306c0o=; b=jz0Wvb/MQBnV8YOgiFnw6pXXwK1AN+HAkC3z5UYr3ILblKpnWD7w7SSyqxK13Ih7I6Jggf ARweTSjpxpsGRAR0Gs8zJHxXGQ+DaTiZEcSxegYBFN7XQT8OcyICCcTHyey5+DtR2rxEDB FJmgHR3DQ46xvxueafeQXg0Y1yZWLwVGE6CFaOsa2aEptpihw9ZziDPTKHwTQHvMQxB8hN u1Oj3rpyjL3YR4G7un7JE2+5sEf/pxrCgLGqNoUIuWjpD0DT3Xy4o9WCcb2IwOWdcZGp8l lAwQczrdD+BbtMT5p6qL+DYPF7xe/kylT5sYNYRiErKoul6BSRI7Oy3EMCLdVA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1630006698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W/9AWcYJSH4xE7X6sIVTqAAgx4sldVO3IC3jE306c0o=; b=9fIii1QVwWn8/vDfNmN5v/tyhO/IFsnpVkSK26Rav/gBnXa1rxBpIriXYLkAbzrpGOXzQD Kwi6kb9TUmrYvIAw== To: Tao Zhou , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, tao.zhou@linux.dev Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira Subject: Re: [PATCH] sched: Fix get_push_task() vs migrate_disable() In-Reply-To: References: <20210826133738.yiotqbtdaxzjsnfj@linutronix.de> Date: Thu, 26 Aug 2021 21:38:17 +0200 Message-ID: <87k0k82dzq.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tao, On Fri, Aug 27 2021 at 00:24, Tao Zhou wrote: > On Thu, Aug 26, 2021 at 03:37:38PM +0200, Sebastian Andrzej Siewior wrote: >> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h >> index e205b63d6db07..32a4945730a9b 100644 >> --- a/kernel/sched/sched.h >> +++ b/kernel/sched/sched.h >> @@ -2259,6 +2259,9 @@ static inline struct task_struct *get_push_task(struct rq *rq) >> if (p->nr_cpus_allowed == 1) >> return NULL; >> >> + if (p->migration_disabled) >> + return NULL; > > Not much I can restore here.. > > Is is_migration_disabled(p) be more correct to check migration > disable. Kinda, but it's not an issue here because get_push_task() is only available when CONFIG_SMP=y which makes p->migration_disabled available as well. > And get_push_task() being called in pull_rt_task() has checked migration > disable first and then call get_push_task(). That means this check in > get_push_task() in patch is a second repeatly check. No. The checks are for two different tasks... Thanks, tglx