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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C4E9C636CD for ; Sat, 4 Feb 2023 03:53:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76EC96B0072; Fri, 3 Feb 2023 22:53:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F7BD6B0073; Fri, 3 Feb 2023 22:53:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5994E6B0074; Fri, 3 Feb 2023 22:53:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 454816B0072 for ; Fri, 3 Feb 2023 22:53:55 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EB1E312029B for ; Sat, 4 Feb 2023 03:53:54 +0000 (UTC) X-FDA: 80428240788.13.D53828C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id AEB8EC0004 for ; Sat, 4 Feb 2023 03:53:52 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SrPBMMYc; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of longman@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=longman@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675482833; h=from:from:sender: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:dkim-signature; bh=buEB2MhYiHkTXl+iJ+h97A75R8p42T/127lL4Ay8x+c=; b=7BwqVAlO0UYufTFXQpWV4kag0+K0g1FlsMPpWe9PPog87M5NBKKJNZTxJOU7Xl87GL9z7i a8JtGMWekfLPaE2qFgg85hscnS4BQZMhfZC54v/rAzJLImQjhIw/Zm7d0nubZrOakGd820 VqCIM/aC6pkSkfzCaSzd2f2OjkI7EcE= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SrPBMMYc; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of longman@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=longman@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675482833; a=rsa-sha256; cv=none; b=FLaXM5bk22YwNV8GJMdY9R6RvP7mluRBA3Le+u6JwF+vEHQxnE/Y6R848TsLfqLkydP3/h fKO8NkIacI2v/Yt03/SClo7QII4dBKuX01lSwnCr+hYGfX30DOoR0fkFjExiMnd8jVDjft oVk85EB8QrHNkzruraiT4hksqHmWVk8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675482831; 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=buEB2MhYiHkTXl+iJ+h97A75R8p42T/127lL4Ay8x+c=; b=SrPBMMYcG8wa41F8+YFsME/GE8qE3GNjq5xZnD1mArZWD8rx8ZUgP5mcDlOoMs9nH+WWxB zT+ue8ad3J1VQzZB2XInCC1Ltr4GD+cjyh/+yA7Otu8toA51cWzOClpQHr/rECUGJtOKIz RtWLJvXLT/KD3pOlD47Y236KwaUkLcI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-94-nr6ADI9gO0uj9McKK4iG3g-1; Fri, 03 Feb 2023 22:53:48 -0500 X-MC-Unique: nr6ADI9gO0uj9McKK4iG3g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CAA54800050; Sat, 4 Feb 2023 03:53:47 +0000 (UTC) Received: from [10.22.8.92] (unknown [10.22.8.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67A8C18EC6; Sat, 4 Feb 2023 03:53:46 +0000 (UTC) Message-ID: <0f388863-9498-e61e-e2dc-965654544489@redhat.com> Date: Fri, 3 Feb 2023 22:53:46 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 2/2] sched/isolation: Add cpu_is_isolated() API Content-Language: en-US To: Frederic Weisbecker , LKML Cc: Roman Gushchin , Michal Hocko , Marcelo Tosatti , Leonardo , Johannes Weiner , Shakeel Butt , Muchun Song , Andrew Morton , Peter Zijlstra , Thomas Gleixner , cgroups@vger.kernel.org, linux-mm@kvack.org References: <20230203232409.163847-1-frederic@kernel.org> <20230203232409.163847-3-frederic@kernel.org> From: Waiman Long In-Reply-To: <20230203232409.163847-3-frederic@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Rspamd-Queue-Id: AEB8EC0004 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: o39c5fzcnxfmgxrx7mbeoydr9p5didtp X-HE-Tag: 1675482832-213271 X-HE-Meta: U2FsdGVkX19JWudzmQ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JtLFXEMTAL2IXZZFxvPPyHnepUJhMGxmWw+pNBqC4JM0FdZHR94DaCg36VIeWicWlco0PkSE03Ipap4fTx1hqEJge7koJby6lHs21oCcAxzu+ZcaewZ5dTbQic2usQ16x9UeDZiFeDK/3VW3sbR+7PgbsfNfsxpdGvwS2u+t5F92Dma1D7yI509jTQUhkBdaC4BO7EUyD6iZgz3+z52z1356cjnPylodyYNvJlIGkza7YGRm6UVxg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2/3/23 18:24, Frederic Weisbecker wrote: > Provide this new API to check if a CPU has been isolated either through > isolcpus= or nohz_full= kernel parameter. > > It aims at avoiding kernel load deemed to be safely spared on CPUs > running sensitive workload that can't bear any disturbance, such as > pcp cache draining. > > Suggested-by: Michal Hocko > Signed-off-by: Frederic Weisbecker > --- > include/linux/sched/isolation.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h > index b645cc81fe01..088672f08469 100644 > --- a/include/linux/sched/isolation.h > +++ b/include/linux/sched/isolation.h > @@ -53,4 +53,10 @@ static inline bool housekeeping_cpu(int cpu, enum hk_type type) > return true; > } > > +static inline bool cpu_is_isolated(int cpu) > +{ > + return !housekeeping_test_cpu(cpu, HK_TYPE_DOMAIN) || > + !housekeeping_test_cpu(cpu, HK_TYPE_KERNEL_NOISE); > +} > + > #endif /* _LINUX_SCHED_ISOLATION_H */ CPUs in an isolated cpuset partition is similar to HK_TYPE_DOMAIN CPUs as load balancing is disabled. I can add an API to access the cpumask and add to this API. However, that list is dynamic as it can be changed at run time. Will that be a problem? Or should that be used separately? Cheers, Longman