From patchwork Thu Oct 13 18:40:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras Soares Passos X-Patchwork-Id: 2336 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp431553wrs; Thu, 13 Oct 2022 11:59:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7omTij1a+9k/dD88AvyL2zqCDB5kjP+5+NzF9zxRCg52VwX9TfUEwyfZVXhmYM72WmlNH6 X-Received: by 2002:a05:6a00:1946:b0:565:c337:c530 with SMTP id s6-20020a056a00194600b00565c337c530mr1205380pfk.47.1665687581232; Thu, 13 Oct 2022 11:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665687581; cv=none; d=google.com; s=arc-20160816; b=ACEBq28V2mGIYtSkaqnppD49VIo9PGOZieIw0h5FcABoYNVEZrRAlBserAj4PVl+nx jm/UtfR91yv/Lm5tget/gASBpG1ErQB/EDxleruyKOwe555vfQTPeAEo9ejDIL3/LU3u mHWHMiWWFgnheWZiLJ1XSIZRyk0G/jbhsALeFyc4Hoa8eFqiuW/SQpLI9Rppl9nWOJxd 9hKtBp/EFW8RdsC0tfZr52Q8coM3cUyM/9KLUBojf7C5ISYP2b6fTBIgN4jG9zt64Io0 xImQc0OS8xINIArEi88sGS6qkobMTdiyspWWJk7iLiPDXjeW2RABH8w96QRI+Rp/bNW0 FEbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8VBqJ4dzJjbnYynK7jkYTYjysfbRi2UUuxGT40j6Ev4=; b=KGbPexqJm6oNUaght2Tp2F5BPKulOVe8pyt8LvlmFHrlP41DzIVkHl120PJO/LEX8S iSKKF57uwyGt1jQL8mAtQvtoNqp17s4IJ6QLOsrbMimfmOEVhDPZDaB/YUh5XHUXYDl2 PMPmSUx75cmFFqyWnwCDQKweH1eUZwpEM/FIgCdXn4b1xbM/34NjzuskIhzD24WDFNiG Gu1cPXgmGF31oZ+VBQKAgJHSXdDxLwkl2iPdM0UZl2EpeAHC6rbHxTq8l5BWnh6Ts/vE tJjegW1L43/bqaAvov+XP+ZAI2/jkBTNjX9QraR9KvjVkS+vyfZNLuSM2jzN7EPnS+yI gqSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bO0AtJSt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a17090aa00a00b001fb4c9b9607si307371pjp.114.2022.10.13.11.59.28; Thu, 13 Oct 2022 11:59:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bO0AtJSt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231791AbiJMSvG (ORCPT + 99 others); Thu, 13 Oct 2022 14:51:06 -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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746600021598675008?= X-GMAIL-MSGID: =?utf-8?q?1746600021598675008?= 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/isolation.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,12 +21,12 @@ enum hk_type { #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); #else From patchwork Thu Oct 13 18:40:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras Soares Passos X-Patchwork-Id: 2325 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp429998wrs; Thu, 13 Oct 2022 11:55:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4xG49tcACbupfhHSjp0XrCVYIEiax1vwdlVT4HIzXOCAAV5uGhg7tQpLnkijOr9jTB6KzT X-Received: by 2002:a17:903:48e:b0:17f:802b:f079 with SMTP id jj14-20020a170903048e00b0017f802bf079mr1352652plb.89.1665687355800; Thu, 13 Oct 2022 11:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665687355; cv=none; d=google.com; s=arc-20160816; b=NWrNOwu3ikz//L/RU5TFV5C2+51+WIo8857r9Qs3EcBpUvoFc9VozCwVvWr6pEahQk 8mld5u7RewNYe7v3Qns7/OUFh6YMk+MpYUiOEEdciYSRT8+5wWqVIxEaupnXBsiTlrW3 cUQ1EvYi8lOf3ImJwoitjn2eqW8+752abSk1nANJT0rv0/TNqkzpYQDzB0Ow1OgKhjhr wQLaNMJ8oWDCnnLhV9ZXAfMGVrEgg3UpKJBGc2eKH+OFYp13SGkMmIGBFoDNnIA9oggj GDgmV+GM740EIeOPKr92ulVx47fTNwFbOlsJg5zaUBEehmSHg76Ush+cgVEzUhfJylA1 knBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6JjDK3twE+pSMUDp2i+4iId8FgNp8eHanR+PXksbbJA=; b=QOhQmLqkarZnQcSm/ANiYCYSsyxrUjbPgYOw86S7iKqt129ugjFt9A6BMMGutNaSo8 YqaSgZuqI1q2XDEVRN8E3vl47LX+7aqo8CWiWdOmnQRWZGnQwHyN2HDWGAWT0sPN6y9G qGVMvjvwzs4gQwtVxDLTiQ+NrojwqKTYZPS3lTha/wzjCftrK1jpZZ+KHKFFyp4kVfV3 L1eWmi58/sCY65aY3PB6Vltjhnm4Uwq4odwAX4oKqUI6Ue+457vmbcCxaiDZFbrN29Gk scqpYjhJc3bSEXGrpUj/zRJl98rnIMpESGGCnZRibVGcptXafQP0J3ujDnT69cNhYn4/ AIvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PmgopVZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a639343000000b00452bab4de6fsi83250pgm.749.2022.10.13.11.55.42; Thu, 13 Oct 2022 11:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PmgopVZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230471AbiJMSpi (ORCPT + 99 others); Thu, 13 Oct 2022 14:45:38 -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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746599784512565726?= X-GMAIL-MSGID: =?utf-8?q?1746599784512565726?= 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/isolation.h index 762701f295d1c..9333c28153a7a 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -7,18 +7,25 @@ #include 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=nohz boot parameter */ + HK_TYPE_DOMAIN, /* See isolcpus=domain boot parameter*/ + HK_TYPE_WQ, /* Work Queues*/ + HK_TYPE_MANAGED_IRQ, /* See isolcpus=managed_irq boot parameter */ + HK_TYPE_KTHREAD, /* kernel threads */ HK_TYPE_MAX }; +/* 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); From patchwork Thu Oct 13 18:40:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras Soares Passos X-Patchwork-Id: 2328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp430128wrs; Thu, 13 Oct 2022 11:56:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75JTjsu6qrfH56giTLSifIqhbIMn3J2ygYIEcYJSyw79GdjM+ZjCLF+SS1H6vP33Tgyvs8 X-Received: by 2002:a63:ff59:0:b0:439:db5:5da9 with SMTP id s25-20020a63ff59000000b004390db55da9mr1161033pgk.88.1665687372488; Thu, 13 Oct 2022 11:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665687372; cv=none; d=google.com; s=arc-20160816; b=ZwgG9boEo6lycpP0fFIvVoSk7LJb1ZRf3ZcSQq7+zntYqX9txL9HrhgKoXDKCoDpbe mmHMRpEfHlz94A2EN90fpvI81ObtLu+MuavWzu/AQ8x63U1tqhpmU03QZjM55bORJuP1 OJJschvMmw4ACERUe1PBNQGD3DsPs/ogEe3As1A0YjVV7Rl4VlNf1RA4KNhe8VHBjwVj AcBcroNFXbs6FxYPNRZXpspXIkbtqG7fCANhmMmNCBT+lMse4pn3Rnvc9PxdssG26VKX 598LOIGk6TPIfAF2px6CdQr0xRM3coLRxxGO4V1Y1j+f7rJd+z1MD921UY27Bb2/ze/d cs5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vsO4hYJKt+wtVYN9Zqac/Tunho9CLrg8yUdRp7WUlZA=; b=uE66tuuY6y79N6IJStnFIAEl/OUVhPwQXOWcV6w/wixExnXWZPx6Xt56Bdz8PTNaf6 yD8d9hp93vLycgD96vGdfb/ZBtMSqEUZ9bybtNHu07EywgWAmtDbeZr4SwuZ9KEncTe8 h3+rIYXBID+ChDOH3k0xV9fxdVZcpynXP/puoW7i0pv+0GdiTtXoXOLzvHogZjdIyNje 5hn++rs6q7FwLwc3gBtYm5HfXHxMFeiPoS8sf4lompicwN6+ofSqNyojwotEWPbjaaVd crF83bDkHD4UyG71Os/ccw0SR1RUn1GHODbOnR7OmRPyTVXnQfshyz1GE1ZPnR2wrWlm Y53g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YemYfWVY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nk5-20020a17090b194500b00202b984842csi320500pjb.35.2022.10.13.11.55.58; Thu, 13 Oct 2022 11:56:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YemYfWVY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232234AbiJMSpv (ORCPT + 99 others); Thu, 13 Oct 2022 14:45:51 -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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746599802602106301?= X-GMAIL-MSGID: =?utf-8?q?1746599802602106301?= 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=domain aggregate both HK_TYPE_DOMAIN and HK_TYPE_WQ, and remove a lot of cpumask_and calls. Also, remove a unnecessary '|=' at housekeeping_isolcpus_setup() since we are sure that 'flags == 0' here. Signed-off-by: Leonardo Bras Signed-off-by: Frederic Weisbecker --- 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, struct pci_dev *dev, pci_physfn_is_probed(dev)) { cpu = nr_cpu_ids; } else { - cpumask_var_t wq_domain_mask; - - if (!zalloc_cpumask_var(&wq_domain_mask, GFP_KERNEL)) { - error = -ENOMEM; - goto out; - } - cpumask_and(wq_domain_mask, - housekeeping_cpumask(HK_TYPE_WQ), - housekeeping_cpumask(HK_TYPE_DOMAIN)); - cpu = cpumask_any_and(cpumask_of_node(node), - wq_domain_mask); - free_cpumask_var(wq_domain_mask); + housekeeping_cpumask(HK_TYPE_WQ)); } 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) if (!strncmp(str, "domain,", 7)) { str += 7; - flags |= HK_FLAG_DOMAIN; + flags |= HK_FLAG_DOMAIN | HK_FLAG_WQ; continue; } @@ -234,7 +234,7 @@ static int __init housekeeping_isolcpus_setup(char *str) /* Default behaviour for isolcpus without flags */ if (!flags) - flags |= HK_FLAG_DOMAIN; + flags = HK_FLAG_DOMAIN | HK_FLAG_WQ; 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) 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)); pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); 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 *queue, } 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); From patchwork Thu Oct 13 18:40:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras Soares Passos X-Patchwork-Id: 2335 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp431143wrs; Thu, 13 Oct 2022 11:58:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7qbTcD6GaFWKWUn68e0DvzUZH9Bwb/QpQX8YgNlk3JIYLjvy07nEDOKqaI/6zZ0WuxEBTm X-Received: by 2002:aa7:8a0d:0:b0:562:a5bf:95e9 with SMTP id m13-20020aa78a0d000000b00562a5bf95e9mr1018021pfa.24.1665687514403; Thu, 13 Oct 2022 11:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665687514; cv=none; d=google.com; s=arc-20160816; b=vBcKDSaFgpzQh1LEPZ1qcy1Z/MGc0v/hQP8EdukGk+x6iugl1Y3PoMGpqDEWtrDD1S jjmYmNmIM8SwReP3Ae7twcah1Dl7FVQaryjosy0/xploeSyieyhMHuB/ChoZNNxh6h4y gAkUSQGrg/4V2ZlsBd8ioBO8rOhz+GqhEfObIQjhu8WNoc5oeKbiNE1VH+4U9D6nmcqa OMAKGYFcIvGMM6BOK7MA6iSRXNeDKHGOOOF9u2kKsRk/P+LKJHV258ptj/rfYlHkhg2y DdM23ubYQqWe5Dj0rUUv5kXgienQh9Qt93DFGCOH+3SLtIezpGRmvUjiLRpUWSSTizbt icXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aO9uwyAWNrITIE0HcaM8sZnAKHxlA4eUnkHhusC4UKE=; b=Aag7mQJH2c/SkXnr5+to44cBByGD9fyVR4Z4nb1wyeD25Fe658zgoaDj1ezoZQJMaY zQIMzXGEmoccA7HGkM+LzQcw/fTWJrW5pBXrxxY21kjUKryyNikoEPt4gp4fE3krYk7n D3lX/XQG3d8Eli7H4k5vlmuuDhqW2yMocI0fSalqgFJUkHS2VuskRBSW0BvsMfmVzOwG kQLewiD9F1aXM/Z0ZLh5J/3E3OUmQFIKRgIOpJNuyrSCur87DUb1GTF/n/FWr2Fdet3Q bnPatrdsoU8TJDa1SOGvFlBJEYvAU3D4rDKnI2IfaWmry16PeZpyQLf/JlYX1OK2w5t/ qFxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QPfowzZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a6541cd000000b0043cb43f582asi131165pgq.564.2022.10.13.11.58.22; Thu, 13 Oct 2022 11:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QPfowzZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbiJMSuK (ORCPT + 99 others); Thu, 13 Oct 2022 14:50:10 -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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746599950997961517?= X-GMAIL-MSGID: =?utf-8?q?1746599950997961517?= 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=... or nohz_full=... 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 static struct padata_instance *pencrypt; static struct padata_instance *pdecrypt; @@ -175,13 +176,15 @@ static int pcrypt_aead_init_tfm(struct crypto_aead *tfm) struct pcrypt_instance_ctx *ictx = aead_instance_ctx(inst); struct pcrypt_aead_ctx *ctx = crypto_aead_ctx(tfm); struct crypto_aead *cipher; + const cpumask_t *hk_wq = housekeeping_cpumask(HK_TYPE_WQ); cpu_index = (unsigned int)atomic_inc_return(&ictx->tfm_count) % - cpumask_weight(cpu_online_mask); + cpumask_weight_and(hk_wq, cpu_online_mask); - ctx->cb_cpu = cpumask_first(cpu_online_mask); + ctx->cb_cpu = cpumask_first_and(hk_wq, cpu_online_mask); for (cpu = 0; cpu < cpu_index; cpu++) - ctx->cb_cpu = cpumask_next(ctx->cb_cpu, cpu_online_mask); + ctx->cb_cpu = cpumask_next_and(ctx->cb_cpu, hk_wq, + cpu_online_mask); cipher = crypto_spawn_aead(&ictx->spawn);