From nobody Tue Apr 7 07:55:56 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB458C433FE for ; Thu, 13 Oct 2022 18:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbiJMSvH (ORCPT ); Thu, 13 Oct 2022 14:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231708AbiJMSub (ORCPT ); Thu, 13 Oct 2022 14:50:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3457541517 for ; Thu, 13 Oct 2022 11:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665686821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8VBqJ4dzJjbnYynK7jkYTYjysfbRi2UUuxGT40j6Ev4=; b=bO0AtJSt49RUg3fghf9eKgPSfRuuBrAHb47oPBMDd2qItIX0AuzVeMrp32wtykSJumDYg+ V5PE36mbWRJm0RJ4kKaMxiagpZOlPKgvNVE+SAw2OZJdBG4CO13bXSu3FRLPHvljkXqLOP OD05vAjnHqnS4QCsFLtKCg1M30vxaM0= Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-651-f-Y6KQlEPpWj25aVtK0HAg-1; Thu, 13 Oct 2022 14:40:56 -0400 X-MC-Unique: f-Y6KQlEPpWj25aVtK0HAg-1 Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-13631a68551so1493048fac.22 for ; Thu, 13 Oct 2022 11:40:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8VBqJ4dzJjbnYynK7jkYTYjysfbRi2UUuxGT40j6Ev4=; b=ittnvjktDOz43Z6jeQGx0d4GGNvdI+1Pb0E6/c7oCIfIh+shDn8Xwg4/dMo/vKgSjJ +oQUFWtmP5TcWpSBvvpyYC0WsL8BfMOYUzG6b3wwLv6F4RmUOYh5sAeOi/1ySOByMiHS gPyzRdXnJaCPEdTkzDNceTr7Akq+Hpgoh0IwbOUJvByv7tmFzy6Ln7Y+bgtOnN4PXt5o PpMvham3tORMljiR7IfGBPgwrTREE0dccKJWOYV3U5nWOejvK0jI2J81e0nosT6nZ+W2 HabgzWXe966iJr90BqAGp2avA1GIG6tZlkRcuenKibZuKRvYaqw2d5tzx8yENovW9Rz4 0AAg== X-Gm-Message-State: ACrzQf33aI3/LSD1KK8z0rqanW+a4i7o1PZnsM3AgD3MDGAQ+leyD3gk cHayFzPg3ol7ly8IlqHAixXBYFaJcb9guSxYKRygH/HfvwPpG171n9BjuvJOQbSogP1wityF6j1 aH/BhkmVa7XmdRk4nqH2+j1XN X-Received: by 2002:a05:6830:3152:b0:661:ceb9:9272 with SMTP id c18-20020a056830315200b00661ceb99272mr667842ots.149.1665686455893; Thu, 13 Oct 2022 11:40:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4nJIAmq9Hq+46Kh8sn9us3gulZMoSvouw/Iy6ORtvgE9Z/MyjjjsC/KzgV7OOt2CYFqnSHDA== X-Received: by 2002:a05:6830:3152:b0:661:ceb9:9272 with SMTP id c18-20020a056830315200b00661ceb99272mr667806ots.149.1665686455653; Thu, 13 Oct 2022 11:40:55 -0700 (PDT) Received: from localhost.localdomain ([2804:1b3:a801:9473:d360:c737:7c9c:d52b]) by smtp.gmail.com with ESMTPSA id v13-20020a05683024ad00b006618ad77a63sm244521ots.74.2022.10.13.11.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 11:40:55 -0700 (PDT) From: Leonardo Bras To: Steffen Klassert , Herbert Xu , "David S. Miller" , Bjorn Helgaas , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tejun Heo , Lai Jiangshan , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Leonardo Bras , Frederic Weisbecker , Phil Auld , Antoine Tenart , Christophe JAILLET , Wang Yufen , mtosatti@redhat.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 1/4] sched/isolation: Fix style issues reported by checkpatch Date: Thu, 13 Oct 2022 15:40:26 -0300 Message-Id: <20221013184028.129486-2-leobras@redhat.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221013184028.129486-1-leobras@redhat.com> References: <20221013184028.129486-1-leobras@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" scripts/checkpatch.pl warns about: - extern prototypes should be avoided in .h files - Missing or malformed SPDX-License-Identifier tag in line 1 Fix those issues to avoid extra noise. Signed-off-by: Leonardo Bras --- include/linux/sched/isolation.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index 8c15abd67aed9..762701f295d1c 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_SCHED_ISOLATION_H #define _LINUX_SCHED_ISOLATION_H =20 @@ -20,12 +21,12 @@ enum hk_type { =20 #ifdef CONFIG_CPU_ISOLATION DECLARE_STATIC_KEY_FALSE(housekeeping_overridden); -extern int housekeeping_any_cpu(enum hk_type type); -extern const struct cpumask *housekeeping_cpumask(enum hk_type type); -extern bool housekeeping_enabled(enum hk_type type); -extern void housekeeping_affine(struct task_struct *t, enum hk_type type); -extern bool housekeeping_test_cpu(int cpu, enum hk_type type); -extern void __init housekeeping_init(void); +int housekeeping_any_cpu(enum hk_type type); +const struct cpumask *housekeeping_cpumask(enum hk_type type); +bool housekeeping_enabled(enum hk_type type); +void housekeeping_affine(struct task_struct *t, enum hk_type type); +bool housekeeping_test_cpu(int cpu, enum hk_type type); +void __init housekeeping_init(void); =20 #else =20 --=20 2.38.0 From nobody Tue Apr 7 07:55:56 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CE51C4332F for ; Thu, 13 Oct 2022 18:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbiJMSpk (ORCPT ); Thu, 13 Oct 2022 14:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbiJMSoE (ORCPT ); Thu, 13 Oct 2022 14:44:04 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6810C2B601 for ; Thu, 13 Oct 2022 11:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665686464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6JjDK3twE+pSMUDp2i+4iId8FgNp8eHanR+PXksbbJA=; b=PmgopVZ4uhKK4wWaSfryKMT76m03M070tT68+3KxMtDYn0HuT9mq5hjrPHBa1RMrWMfh/G Y/84zmWGDccMZD8uXk3ThcS5Z4uEnNVt7VjvoEB1KcZbPJc0Bp4M5+zJgzWiedWNwRjQ0S LKsEnPaNhFQsa+GYeWFNxcHm9Pnc/V4= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-331-3l9a5KStOp6pNqlx61X7Vw-1; Thu, 13 Oct 2022 14:41:03 -0400 X-MC-Unique: 3l9a5KStOp6pNqlx61X7Vw-1 Received: by mail-oo1-f70.google.com with SMTP id n5-20020a4a3445000000b004728fe7a331so1267361oof.23 for ; Thu, 13 Oct 2022 11:41:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6JjDK3twE+pSMUDp2i+4iId8FgNp8eHanR+PXksbbJA=; b=pAj0vEImqIQyGigHfnDg8Xr0V16uDz3Rtc0U70lDMkULng4RBXhRgg9/NPVrQhcn+i isMZC1UQGxVqnms6THGEZdJT+XoZptMl7ejErMmGreSlS89zyx0mWtSycSk9fsLWLHxy ZSdlRp/9SmX8gKqb/BsLcCA3JPbJRnPRYm2BEXYBX7glmndIumRFBjXTrq2LAtfE4+2N zeUmaDS+sm1ERHFqO4oFTGykyKevu7uFNrd4HUoKPMW6VNZOeB7PSKBxO2p20N7oQxq2 c2exS4CwrL8eCUo2kNnRpNzbLfZA3sBbgCrrsodxkVnX8x+a+zsSIh5Kyjvxzb2ySdRI HY7A== X-Gm-Message-State: ACrzQf1PN9sSyG3WHY0jgrFQsL/4tnAB3O6wCcCe9ZpJZ1cy5xiKOBgs 3LNLFVurqbQfDMPVf7drQroBJi5WFs9SoiVeH7CFbjKNQtLlRy9IMUdFtSxr2uBIn3L3k9RSh1r ht7JfGpzTx6P6XwTGCyrbt7Mm X-Received: by 2002:a9d:2d81:0:b0:658:accf:2adf with SMTP id g1-20020a9d2d81000000b00658accf2adfmr688467otb.334.1665686462129; Thu, 13 Oct 2022 11:41:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7TiIyrwXPFplLjLvX4+bEb60ttonBBZ0lr/zrMURi69WbZIZ4juK0apaIljHzLOixeLkyFDw== X-Received: by 2002:a9d:2d81:0:b0:658:accf:2adf with SMTP id g1-20020a9d2d81000000b00658accf2adfmr688432otb.334.1665686461891; Thu, 13 Oct 2022 11:41:01 -0700 (PDT) Received: from localhost.localdomain ([2804:1b3:a801:9473:d360:c737:7c9c:d52b]) by smtp.gmail.com with ESMTPSA id v13-20020a05683024ad00b006618ad77a63sm244521ots.74.2022.10.13.11.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 11:41:01 -0700 (PDT) From: Leonardo Bras To: Steffen Klassert , Herbert Xu , "David S. Miller" , Bjorn Helgaas , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tejun Heo , Lai Jiangshan , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Leonardo Bras , Frederic Weisbecker , Phil Auld , Antoine Tenart , Christophe JAILLET , Wang Yufen , mtosatti@redhat.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 2/4] sched/isolation: Improve documentation Date: Thu, 13 Oct 2022 15:40:27 -0300 Message-Id: <20221013184028.129486-3-leobras@redhat.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221013184028.129486-1-leobras@redhat.com> References: <20221013184028.129486-1-leobras@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Improve documentation on housekeeping types and what to expect from housekeeping functions. Signed-off-by: Leonardo Bras --- include/linux/sched/isolation.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index 762701f295d1c..9333c28153a7a 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -7,18 +7,25 @@ #include =20 enum hk_type { - HK_TYPE_TIMER, - HK_TYPE_RCU, - HK_TYPE_MISC, - HK_TYPE_SCHED, - HK_TYPE_TICK, - HK_TYPE_DOMAIN, - HK_TYPE_WQ, - HK_TYPE_MANAGED_IRQ, - HK_TYPE_KTHREAD, + HK_TYPE_TIMER, /* Timer interrupt, watchdogs */ + HK_TYPE_RCU, /* RCU callbacks */ + HK_TYPE_MISC, /* Minor housekeeping categories */ + HK_TYPE_SCHED, /* Scheduling and idle load balancing */ + HK_TYPE_TICK, /* See isolcpus=3Dnohz boot parameter */ + HK_TYPE_DOMAIN, /* See isolcpus=3Ddomain boot parameter*/ + HK_TYPE_WQ, /* Work Queues*/ + HK_TYPE_MANAGED_IRQ, /* See isolcpus=3Dmanaged_irq boot parameter */ + HK_TYPE_KTHREAD, /* kernel threads */ HK_TYPE_MAX }; =20 +/* Kernel parameters like nohz_full and isolcpus allow passing cpu numbers + * for disabling housekeeping types. + * + * The functions bellow work the opposite way, by referencing which cpus + * are able to perform the housekeeping type in parameter. + */ + #ifdef CONFIG_CPU_ISOLATION DECLARE_STATIC_KEY_FALSE(housekeeping_overridden); int housekeeping_any_cpu(enum hk_type type); --=20 2.38.0 From nobody Tue Apr 7 07:55:56 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF810C4332F for ; Thu, 13 Oct 2022 18:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiJMSpw (ORCPT ); Thu, 13 Oct 2022 14:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232211AbiJMSow (ORCPT ); Thu, 13 Oct 2022 14:44:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C6D95A14E for ; Thu, 13 Oct 2022 11:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665686471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vsO4hYJKt+wtVYN9Zqac/Tunho9CLrg8yUdRp7WUlZA=; b=YemYfWVYWdoYcieLZd7Ad7PNsZt7CJgWMiosvUNRoifEEFllLpSVeIuRj2R/+ECH5BRDvK pwfmOSbv3+btry+zbS2aNGZwOjyfN/czZx49rxJOukNs+quZSrifH9l8VkQNawkzPyKVT5 UnBXH1L+S7RIBLFf5Xh6M6Y7q4iu5hs= Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-22-25EcX6d8PoagtUEumReSPg-1; Thu, 13 Oct 2022 14:41:09 -0400 X-MC-Unique: 25EcX6d8PoagtUEumReSPg-1 Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-132ac95c2abso1490962fac.23 for ; Thu, 13 Oct 2022 11:41:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vsO4hYJKt+wtVYN9Zqac/Tunho9CLrg8yUdRp7WUlZA=; b=pRBw7rt+rr/4+7ugYtCEpD2vQ3Ka/KLKfgO3FYqJ7SkL4OVCkXChXXLpFkjuWmuJ39 qP1FMw+DrYQqpVt2WpztG3/eYhGGpjW8feWDLltFA2+4N8I977/8Lr9ZrB8ENvUf3K9E CnW/c/VAgoJzQF1ixdwNYcqDUE/S6f/wy+SEbZZDvm+aav1tXeMSFiDphZyT6cBmkuvN RpdLym7RDSVqR4wDrWRwsBHQQAFwPEfXneRRMNX7JOOelzcLwqDLCBxYI7o9F/SjaZOT loSkBqQtAbVOnVcsxtj3aAgCVsN+c3BS85BsLmgzd6jdDHWpdkjdN+ja6TIDfM/VzZjF aIFg== X-Gm-Message-State: ACrzQf16Of/SC8lGbERzGxjbH4JljX/FjTxMyadlY4FSXKiFyMiuo1rB 12M3kdqj2NcOXRt7gKBu8WzVr7Sh0uXiuIaA9Td1iLo5FhAiepwH1LLc/T29reJojoqcoSL/R/X sZ+X4Q1rn1H704jT8KyjkqsLa X-Received: by 2002:a05:6808:10c3:b0:350:e563:7c4a with SMTP id s3-20020a05680810c300b00350e5637c4amr598502ois.182.1665686468380; Thu, 13 Oct 2022 11:41:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GzHFdCUGCQhqNsosJjZKt8Eeu2wVwQ9Do3KHBGqH13o0NNm/9FKqwNNjhBy1g53fEGrBUSA== X-Received: by 2002:a05:6808:10c3:b0:350:e563:7c4a with SMTP id s3-20020a05680810c300b00350e5637c4amr598464ois.182.1665686468134; Thu, 13 Oct 2022 11:41:08 -0700 (PDT) Received: from localhost.localdomain ([2804:1b3:a801:9473:d360:c737:7c9c:d52b]) by smtp.gmail.com with ESMTPSA id v13-20020a05683024ad00b006618ad77a63sm244521ots.74.2022.10.13.11.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 11:41:07 -0700 (PDT) From: Leonardo Bras To: Steffen Klassert , Herbert Xu , "David S. Miller" , Bjorn Helgaas , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tejun Heo , Lai Jiangshan , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Leonardo Bras , Frederic Weisbecker , Phil Auld , Antoine Tenart , Christophe JAILLET , Wang Yufen , mtosatti@redhat.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 3/4] sched/isolation: Add HK_TYPE_WQ to isolcpus=domain Date: Thu, 13 Oct 2022 15:40:28 -0300 Message-Id: <20221013184028.129486-4-leobras@redhat.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221013184028.129486-1-leobras@redhat.com> References: <20221013184028.129486-1-leobras@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Housekeeping code keeps multiple cpumasks in order to keep track of which cpus can perform given housekeeping category. Every time the HK_TYPE_WQ cpumask is checked before queueing work at a cpu WQ it also happens to check for HK_TYPE_DOMAIN. So It can be assumed that the Domain isolation also ends up isolating work queues. Delegating current HK_TYPE_DOMAIN's work queue isolation to HK_TYPE_WQ makes it simpler to check if a cpu can run a task into an work queue, since code just need to go through a single HK_TYPE_* cpumask. Make isolcpus=3Ddomain aggregate both HK_TYPE_DOMAIN and HK_TYPE_WQ, and remove a lot of cpumask_and calls. Also, remove a unnecessary '|=3D' at housekeeping_isolcpus_setup() since we are sure that 'flags =3D=3D 0' here. Signed-off-by: Leonardo Bras --- drivers/pci/pci-driver.c | 13 +------------ kernel/sched/isolation.c | 4 ++-- kernel/workqueue.c | 1 - net/core/net-sysfs.c | 1 - 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 107d77f3c8467..550bef2504b8d 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -371,19 +371,8 @@ static int pci_call_probe(struct pci_driver *drv, stru= ct pci_dev *dev, pci_physfn_is_probed(dev)) { cpu =3D nr_cpu_ids; } else { - cpumask_var_t wq_domain_mask; - - if (!zalloc_cpumask_var(&wq_domain_mask, GFP_KERNEL)) { - error =3D -ENOMEM; - goto out; - } - cpumask_and(wq_domain_mask, - housekeeping_cpumask(HK_TYPE_WQ), - housekeeping_cpumask(HK_TYPE_DOMAIN)); - cpu =3D cpumask_any_and(cpumask_of_node(node), - wq_domain_mask); - free_cpumask_var(wq_domain_mask); + housekeeping_cpumask(HK_TYPE_WQ)); } =20 if (cpu < nr_cpu_ids) diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 373d42c707bc5..ced4b78564810 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -204,7 +204,7 @@ static int __init housekeeping_isolcpus_setup(char *str) =20 if (!strncmp(str, "domain,", 7)) { str +=3D 7; - flags |=3D HK_FLAG_DOMAIN; + flags |=3D HK_FLAG_DOMAIN | HK_FLAG_WQ; continue; } =20 @@ -234,7 +234,7 @@ static int __init housekeeping_isolcpus_setup(char *str) =20 /* Default behaviour for isolcpus without flags */ if (!flags) - flags |=3D HK_FLAG_DOMAIN; + flags =3D HK_FLAG_DOMAIN | HK_FLAG_WQ; =20 return housekeeping_setup(str, flags); } diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 7cd5f5e7e0a1b..b557daa571f17 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -6004,7 +6004,6 @@ void __init workqueue_init_early(void) =20 BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL)); cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(HK_TYPE_WQ)); - cpumask_and(wq_unbound_cpumask, wq_unbound_cpumask, housekeeping_cpumask(= HK_TYPE_DOMAIN)); =20 pwq_cache =3D KMEM_CACHE(pool_workqueue, SLAB_PANIC); =20 diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 8409d41405dfe..7b6fb62a118ab 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -852,7 +852,6 @@ static ssize_t store_rps_map(struct netdev_rx_queue *qu= eue, } =20 if (!cpumask_empty(mask)) { - cpumask_and(mask, mask, housekeeping_cpumask(HK_TYPE_DOMAIN)); cpumask_and(mask, mask, housekeeping_cpumask(HK_TYPE_WQ)); if (cpumask_empty(mask)) { free_cpumask_var(mask); --=20 2.38.0 From nobody Tue Apr 7 07:55:56 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B794C433FE for ; Thu, 13 Oct 2022 18:50:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbiJMSuL (ORCPT ); Thu, 13 Oct 2022 14:50:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbiJMSsu (ORCPT ); Thu, 13 Oct 2022 14:48:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F1E4DB32 for ; Thu, 13 Oct 2022 11:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665686700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aO9uwyAWNrITIE0HcaM8sZnAKHxlA4eUnkHhusC4UKE=; b=QPfowzZiWR8iUP+/Q6j2uJhTWsPFRgomnfQwPckiE8eSvEVIC4zgE8Xc/0FZUyxGZyNbdZ J5sbuGKLFY0LKWRPi38V/tg6A4OuHQqMW9xi/0D9UZSEUZgnwlAjN1E9Cw7a8tqo6ASZlq s9n69GxegSj2I9+IH8e+SGFFz08GMNc= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-623-UG68dnRVP3-4Kmh_LPpZ9w-1; Thu, 13 Oct 2022 14:41:15 -0400 X-MC-Unique: UG68dnRVP3-4Kmh_LPpZ9w-1 Received: by mail-oi1-f199.google.com with SMTP id r129-20020aca5d87000000b00350a28e1ba2so1101726oib.14 for ; Thu, 13 Oct 2022 11:41:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aO9uwyAWNrITIE0HcaM8sZnAKHxlA4eUnkHhusC4UKE=; b=aM/gsTl0LO6ntygeHiPnefvuMGZMSQTvlAG5vlzUSs9mfgZqqHEIX1+GlZYhJ9lPvc ko9ZGwiN8J3r32bBNyg8XhZWVq/jo+d4DoSSZmz983EIV4EqrnJFOpsqZvG2YmsVaEoJ hz+RIDzMeOAyP6fOpVjnyaIM1xChHN6mFMJI/9IANqUZcpYehX/CkLRQ4sJ6NKvzz4JH BtAuxAQesyqZ7//Ut7xVWul2WnCuCVG0UYmLS0MQ+DwxXaCWVandsegIbnoWhTiNQYn8 07BDoVWFG4b2ZWATIKqRTnpW6lmk+gGwzlPrZqDB9Lhp+RiPcw4KaGprEYpDIzP9Ngps yukQ== X-Gm-Message-State: ACrzQf29vUDveJp/fWm0istixdNin0dokBBkFeu1YhjGqf0Q+ZbPRN22 fhK5zZzKhcdAivGy7mPBh2lKZbeHZEmKzHKptr0TrN5559L+x3uTwisPO+DbxLKWBxAqlbFpwoR akZ2dkhegB2eAaeo7E/wDO3yE X-Received: by 2002:a05:6870:596:b0:12d:91cd:cf36 with SMTP id m22-20020a056870059600b0012d91cdcf36mr6446083oap.84.1665686474662; Thu, 13 Oct 2022 11:41:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM52k3vKtIVGL+BfBIsY/ib9UZWiX3f2GV5v2CeLaUkMNUjAO0cLO7Cc3TLwdOlxaDtAQIvz/Q== X-Received: by 2002:a05:6870:596:b0:12d:91cd:cf36 with SMTP id m22-20020a056870059600b0012d91cdcf36mr6446050oap.84.1665686474448; Thu, 13 Oct 2022 11:41:14 -0700 (PDT) Received: from localhost.localdomain ([2804:1b3:a801:9473:d360:c737:7c9c:d52b]) by smtp.gmail.com with ESMTPSA id v13-20020a05683024ad00b006618ad77a63sm244521ots.74.2022.10.13.11.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 11:41:14 -0700 (PDT) From: Leonardo Bras To: Steffen Klassert , Herbert Xu , "David S. Miller" , Bjorn Helgaas , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tejun Heo , Lai Jiangshan , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Leonardo Bras , Frederic Weisbecker , Phil Auld , Antoine Tenart , Christophe JAILLET , Wang Yufen , mtosatti@redhat.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 4/4] crypto/pcrypt: Do not use isolated CPUs for callback Date: Thu, 13 Oct 2022 15:40:29 -0300 Message-Id: <20221013184028.129486-5-leobras@redhat.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221013184028.129486-1-leobras@redhat.com> References: <20221013184028.129486-1-leobras@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently pcrypt_aead_init_tfm() will pick callback cpus (ctx->cb_cpu) from any online cpus. Later padata_reorder() will queue_work_on() the chosen cb_cpu. This is undesired if the chosen cb_cpu is listed as isolated (i.e. using isolcpus=3D... or nohz_full=3D... kernel parameters), since the work queued will interfere with the workload on the isolated cpu. Make sure isolated cpus are not used for pcrypt. Signed-off-by: Leonardo Bras --- crypto/pcrypt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c index 9d10b846ccf73..0162629a03957 100644 --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 static struct padata_instance *pencrypt; static struct padata_instance *pdecrypt; @@ -175,13 +176,15 @@ static int pcrypt_aead_init_tfm(struct crypto_aead *t= fm) struct pcrypt_instance_ctx *ictx =3D aead_instance_ctx(inst); struct pcrypt_aead_ctx *ctx =3D crypto_aead_ctx(tfm); struct crypto_aead *cipher; + const cpumask_t *hk_wq =3D housekeeping_cpumask(HK_TYPE_WQ); =20 cpu_index =3D (unsigned int)atomic_inc_return(&ictx->tfm_count) % - cpumask_weight(cpu_online_mask); + cpumask_weight_and(hk_wq, cpu_online_mask); =20 - ctx->cb_cpu =3D cpumask_first(cpu_online_mask); + ctx->cb_cpu =3D cpumask_first_and(hk_wq, cpu_online_mask); for (cpu =3D 0; cpu < cpu_index; cpu++) - ctx->cb_cpu =3D cpumask_next(ctx->cb_cpu, cpu_online_mask); + ctx->cb_cpu =3D cpumask_next_and(ctx->cb_cpu, hk_wq, + cpu_online_mask); =20 cipher =3D crypto_spawn_aead(&ictx->spawn); =20 --=20 2.38.0