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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1834EC47096 for ; Thu, 3 Jun 2021 09:45:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD57F613E6 for ; Thu, 3 Jun 2021 09:45:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD57F613E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=v7m8gCFqw8gfwyvBosrxBXuti1a513XasSzkh8UDudo=; b=J0Q5oyxqu2B6D+16lMpMSvv8N0 03GXzPxbaPDWWd1EEApVNGzNj0PSktXQrlgF0yIrTYImisxO2ukuuSejiURPmnf07bEujmFqhPMIr AwsvDUBLk639QlDlHxbkbDVXVFyLmocKtexcPBI7s/NeQhXeVoYdXPY4+oqqXISIq17WbYIJdxGrc vSRKvgFPjPC2Sh/f+MbkwYOt7bdTtK0ntDdfAPNeOxdvGB1c2X7Sox3gLXvornKJkarCFNKL1UxVF DrLj+ECYVAE0Cue17T4h6uLdTV3Q6SpQMqMdQBgYO1SNOX7zF8+RpqynyHBS0zS9T91f+xG7/7RtA 3vB5ycHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lojso-007tiq-Bc; Thu, 03 Jun 2021 09:43:22 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lojsk-007thS-3I for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 09:43:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622713394; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mKMol+hh4H5zAjzMENNUa+8kH/VPxhGbEihDFShSPDw=; b=dS62Pq0qMGcyDUlY4CmKstEZYmb5noE+gLyL/Il6NBzP89Lq3vb6b1xQdJlETWFFdmkM14 xppXjL0AzwcGrlB6uv94HLEFjjHU/S+mIDZrpkkHQ5FtagOQbAN7EHTVp3AaTkI2iaPm5R JrAtq5copcNUE94f9zm0XZt6M0BiUEQ= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-CSGSgOSsNheS6LARApF1vw-1; Thu, 03 Jun 2021 05:43:12 -0400 X-MC-Unique: CSGSgOSsNheS6LARApF1vw-1 Received: by mail-ed1-f71.google.com with SMTP id y7-20020aa7ce870000b029038fd7cdcf3bso2966858edv.15 for ; Thu, 03 Jun 2021 02:43:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mKMol+hh4H5zAjzMENNUa+8kH/VPxhGbEihDFShSPDw=; b=SLt5E7AA3G6y08DnD85ZKI7D5k9mDVAaxtaM4SrtMIz2dgzjgYQXt1X5zyoVWqyGZ3 Uu1X7b4Tf+8051rt4w0ij4Mi71OLHYZlFPWW4uDci/QT9tATv4/qU4NlgicxeYkvqqUH K3iRB2RtvR+PuoEwcufNJBFDyhlQXf5LjEo4ncMbXEMZ01WeHeVSWS+fiG3nKnQG+tNi gjYs9xQa/5DkERlDbWkrfAZJm4dK+Mzq6lKJIcQYW2zpeq0PDBLIh+XKnWTCgL5LUpIN Zqyxq4yPfi1SW66kSf+5iA3EIiO6b3Mx6KBm8hRaF2nn+plGwNfN2mWB5FD69WpHDU4Y 3ufQ== X-Gm-Message-State: AOAM53222FIb8sdn/JK05Fsozt2193WBbHQp1kwhHhcUrCgQzJwchroa tEN6TwaELFq5ukuFQ3wXDyg9i98cCNPQziBNlcQZCvE1OWxg9SzOMk4TVRIPgEkzDyRCzln6aFu HaRlTs6f5D/62ZwDYke+DnzCezUoOK/Nveck= X-Received: by 2002:a17:906:2bd0:: with SMTP id n16mr38690904ejg.110.1622713391373; Thu, 03 Jun 2021 02:43:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGGXhqOBJzJuRPfjz4w/AmB4eDpBp9mpU61CFg7DVKMZu78HrRGHPAh+vd/LwxWHThjtnZ9g== X-Received: by 2002:a17:906:2bd0:: with SMTP id n16mr38690899ejg.110.1622713391203; Thu, 03 Jun 2021 02:43:11 -0700 (PDT) Received: from x1.bristot.me (host-79-24-6-4.retail.telecomitalia.it. [79.24.6.4]) by smtp.gmail.com with ESMTPSA id a7sm1455529edr.15.2021.06.03.02.43.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 02:43:10 -0700 (PDT) Subject: Re: [PATCH v8 12/19] sched: Introduce task_cpus_dl_admissible() to check proposed affinity To: Will Deacon , linux-arm-kernel@lists.infradead.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , Dietmar Eggemann , Valentin Schneider , kernel-team@android.com References: <20210602164719.31777-1-will@kernel.org> <20210602164719.31777-13-will@kernel.org> From: Daniel Bristot de Oliveira Message-ID: <5ab65165-49e6-633f-d4a5-9538fb72cc36@redhat.com> Date: Thu, 3 Jun 2021 11:43:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602164719.31777-13-will@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bristot@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_024318_260602_88012DEF X-CRM114-Status: GOOD ( 18.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 6/2/21 6:47 PM, Will Deacon wrote: > In preparation for restricting the affinity of a task during execve() > on arm64, introduce a new task_cpus_dl_admissible() helper function to > give an indication as to whether the restricted mask is admissible for > a deadline task. > > Signed-off-by: Will Deacon > --- > include/linux/sched.h | 6 ++++++ > kernel/sched/core.c | 44 +++++++++++++++++++++++++++---------------- > 2 files changed, 34 insertions(+), 16 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 91a6cfeae242..9b17d8cfa6ef 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -1691,6 +1691,7 @@ extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new > extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask); > extern int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node); > extern void release_user_cpus_ptr(struct task_struct *p); > +extern bool task_cpus_dl_admissible(struct task_struct *p, const struct cpumask *mask); > extern void force_compatible_cpus_allowed_ptr(struct task_struct *p); > extern void relax_compatible_cpus_allowed_ptr(struct task_struct *p); > #else > @@ -1713,6 +1714,11 @@ static inline void release_user_cpus_ptr(struct task_struct *p) > { > WARN_ON(p->user_cpus_ptr); > } > + > +static inline bool task_cpus_dl_admissible(struct task_struct *p, const struct cpumask *mask) > +{ > + return true; > +} > #endif > > extern int yield_to(struct task_struct *p, bool preempt); > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 58e2cf7520c0..b4f8dc18ae11 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -6933,6 +6933,31 @@ SYSCALL_DEFINE4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr, > return retval; > } > > +#ifdef CONFIG_SMP > +bool task_cpus_dl_admissible(struct task_struct *p, const struct cpumask *mask) Would you mind renaming it to dl_task_check_affinity(), in the case of a v9? It will look coherent with dl_task_can_attach()... Reviewed-by: Daniel Bristot de Oliveira Thanks! -- Daniel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel