Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2126754ybh; Fri, 24 Jul 2020 05:11:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMukFi8g3ZKzrZ0rKckxZmygyvlFAHTClC2NNnBWTynFIQ6DVJH+Q9V92yqsx7RxboHRIy X-Received: by 2002:a17:906:7a46:: with SMTP id i6mr8544405ejo.475.1595592696169; Fri, 24 Jul 2020 05:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595592696; cv=none; d=google.com; s=arc-20160816; b=u3ZSWwOInRzxboPo5INWSsczZW5N9UxLl6vQDAIYo+8EjuGM+VaLC6uBRRJwJC5A48 PIF55izcaFRZ9Rm7/QlnZNUu+sxMy3J7rcfvmGbZmzVGrdDnBJ1Mh5ygbbGhQjqQgRat Ac6Oryu5IglJsdfVq5g6XOV7y6JmdGQ1OOikKVi/HqDKplMrr6z5sNTRweBk1DyEMuG1 Fqd4V9hj1Cb/oJFxz6NlPNjlH0I9P1BFM8A3uD5TjsoP1m0PDXOkFqAmQho2N2LH4DFh 43V60qlA/Ug8mWEkh3Hgw91uqEuJog27CaehHPLSxcUgxwwaR8nQj0qeb+cXiO1+MMee l9wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=rbilDyoAGD8fHqiMG+SK9j6c/X8TIU1Eaip9AXG2aTM=; b=pg3d7nyW0dLmenw7aJ/MoH7CtUiuvLC05SWZWh1SLSvdNQPxhUE1z2El1PIGoaS/2u 1vK500ak1omUNh7tUS96+VWa6iNMfr473kLnFoqX0Zhz1NJZa+Ijit33wsQZt0tW72O1 CmV6Hhh4RFGgya0IQAzEDDzoqZZfDkd5KGusTxOXbGX8UH5XILl4QCkybl8M6BzVvite fO8Qd/Hgx3Pn52UXrG6QR8BE4H29aMvo5e/uowbuepKubjWgNKlDzhMinSxAerOZVNQg IHBv/vl7W5hjGTMWwh4B3I0BeT1SXQH0NK+HPbA0BGh+eKNnXHX58lbhCXm209xCQ6fr 0jRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s0YrLs84; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si367147edw.533.2020.07.24.05.11.13; Fri, 24 Jul 2020 05:11:36 -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=@gmail.com header.s=20161025 header.b=s0YrLs84; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbgGXMJB (ORCPT + 99 others); Fri, 24 Jul 2020 08:09:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbgGXMI4 (ORCPT ); Fri, 24 Jul 2020 08:08:56 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA332C0619D3 for ; Fri, 24 Jul 2020 05:08:55 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id x5so7191136wmi.2 for ; Fri, 24 Jul 2020 05:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rbilDyoAGD8fHqiMG+SK9j6c/X8TIU1Eaip9AXG2aTM=; b=s0YrLs84fl1PmDJdDFoY0Oz6m7PkbwBWhwEOgH/gB5Fe65olAPq2wbnB846Zr7Smu9 ZKmCvFbu4M3IjoTgeVO/wI4v8SaaDtpfyypZybREdhQip4WTcBm+Rx8GPrf37Li1kxsf /+4H/blRZVjNaHVBH3d/AnF4DnyvNaS4XZgkbJmK+wopwVhmaHWOUOh4AYgzbmwogjiM rbcLQt2pycRor1soqxpM5MFeAfsxDLC/gESoT5v6Y0aYvz+uWLZiPLXEYsNfLsgxuRkE UP74bilx+KRJWYIiDJr488q4/nafesBrlecnMbVXgzF3qZFwLQL73jToOU3LpfR1hNtH 6+cw== 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:content-transfer-encoding; bh=rbilDyoAGD8fHqiMG+SK9j6c/X8TIU1Eaip9AXG2aTM=; b=BxPsW9IN8NtVUfS9LpvaUMZffRodNgTjF6TmByutH3TPM4T174vBa2vikkhv/Q5g9h qB6Z5Dpqa08VTMXo9t1U/pzdRpqvxw+2MyU7w+dOJb2zgSs/S9ad8lkBBIIQ70vLo8BW Dc0Vo6IKqijaNkFi8XYDDlV1x8xcG2JD5ga1S7Zn8xkbpA4tiDWrzMWpw+752Z3EtgSH 5h1Uxj6kfpz3fgp1Th8WwTAkeRyWFXgZ2WvIYGr5txB4c1ZdDW2kOld+j7p0TQGRY4Nh w4uwxk4RZMh5UG7v2qJzbdq6MncZU7V/H25Yjjv8l0A2o6J22aHnoWvKuG5q+CGibeH1 Dsug== X-Gm-Message-State: AOAM532+SwqWDgbFlMruSEhOyqrzewCpE/yq598wQ5PGX6gI1wYyRB27 Kqx0arP4jmW5WhgK6wTJxbMjhinMvGZiwkq+rR8= X-Received: by 2002:a1c:28a:: with SMTP id 132mr8365570wmc.109.1595592534535; Fri, 24 Jul 2020 05:08:54 -0700 (PDT) MIME-Version: 1.0 References: <2d0e3da8c80c314048d598fb03ae3fe52d9619f3.1593530334.git.vpillai@digitalocean.com> <4229D3E1-8792-4B43-9AC4-F648D49CCC99@tencent.com> <20200724071458.lah33iacywx35hdi@aaronlu-desktop> In-Reply-To: <20200724071458.lah33iacywx35hdi@aaronlu-desktop> From: Jiang Biao Date: Fri, 24 Jul 2020 20:08:43 +0800 Message-ID: Subject: Re: [RFC PATCH 09/16] sched/fair: core wide cfs task priority comparison(Internet mail) To: Aaron Lu Cc: =?UTF-8?B?YmVuYmppYW5nKOiSi+W9qik=?= , Vineeth Remanan Pillai , Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , "mingo@kernel.org" , "tglx@linutronix.de" , "pjt@google.com" , "torvalds@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "subhra.mazumdar@oracle.com" , "fweisbec@gmail.com" , "keescook@chromium.org" , "kerrnel@google.com" , Phil Auld , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , Joel Fernandes , "Joel Fernandes (Google)" , "vineethrp@gmail.com" , Chen Yu , Christian Brauner , Aaron Lu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Jul 2020 at 15:17, Aaron Lu wrote: > > On Wed, Jul 22, 2020 at 12:23:44AM +0000, benbjiang(=E8=92=8B=E5=BD=AA) w= rote: > > > > > > > +/* > > > + * This function takes care of adjusting the min_vruntime of sibling= s of > > > + * a core during coresched enable/disable. > > > + * This is called in stop machine context so no need to take the rq = lock. > > Hi, > > > > IMHO, it seems that stop machine context cannot guarantee race free. Th= e param *cpu* maybe not *this_cpu*, rq lock should be taken even in stop ma= chine context, and irq should be disabled too, to avoid potential races wit= h other contexts. > > > > In stop machine context, all CPUs except the active ones are spinning > with irq disabled and in this invocation of stop_machine(), only one > CPU is active so I don't think race is possible. You're right, stop_machine provides much more protection than stop_*_cpu. Thanks for the explanation. Regards, Jiang