From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by aws-us-west-2-korg-lkml-1.web.codeaurora.org (Postfix) with ESMTP id 9C39CC433EF for ; Thu, 14 Jun 2018 13:45:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52E3B208D8 for ; Thu, 14 Jun 2018 13:45:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52E3B208D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755181AbeFNNpX (ORCPT ); Thu, 14 Jun 2018 09:45:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:40082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754912AbeFNNpW (ORCPT ); Thu, 14 Jun 2018 09:45:22 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 79C9E20020; Thu, 14 Jun 2018 13:45:20 +0000 (UTC) Date: Thu, 14 Jun 2018 09:45:18 -0400 From: Steven Rostedt To: Juri Lelli Cc: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, mathieu.poirier@linaro.org, lizefan@huawei.com, cgroups@vger.kernel.org Subject: Re: [PATCH v4 4/5] sched/core: Prevent race condition between cpuset and __sched_setscheduler() Message-ID: <20180614094518.00a181cf@gandalf.local.home> In-Reply-To: <20180613121711.5018-5-juri.lelli@redhat.com> References: <20180613121711.5018-1-juri.lelli@redhat.com> <20180613121711.5018-5-juri.lelli@redhat.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jun 2018 14:17:10 +0200 Ju > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index b42037e6e81d..d26fd4795aa3 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -2409,6 +2409,22 @@ void __init cpuset_init_smp(void) > BUG_ON(!cpuset_migrate_mm_wq); > } > > +/** > + * cpuset_lock - Grab the cpuset_mutex from another subsysytem > + */ > +int cpuset_lock(void) Shouldn't this be called "cpuset_trylock()" otherwise one may think that it will always return with the cpuset_mutex locked. -- Steve > +{ > + return mutex_trylock(&cpuset_mutex); > +} > + > +/** > + * cpuset_unlock - Release the cpuset_mutex from another subsysytem > + */