Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp855262imn; Tue, 26 Jul 2022 11:08:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tk6XY9sGI5m+QbtIsj2/5ulcBJfoLAbuAr+swaUfRSOuZUmmFpUg99hEI9EitzI9ZrIoYa X-Received: by 2002:a17:907:3d94:b0:72b:54bc:aa38 with SMTP id he20-20020a1709073d9400b0072b54bcaa38mr15365608ejc.679.1658858891150; Tue, 26 Jul 2022 11:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658858891; cv=none; d=google.com; s=arc-20160816; b=CcEgdn/ojLmr2fcwGvt28jU9U7dOZ97PxlbW9mOoW/SNss2gDW5l/RyY9+uXHukp1H TYXcmnldrbHoW3WFFWijM7NyCf+PLD5oq1BcmeOSHGpn5NBA6B8JRtm4SI4FdgzEqVFh 1HEdmC55cY2VfnjuYIW6u+RSbTRSgj68NaFTmFLTyJJWj6VqzJXToUygdKSaUZg8IdJT m+VE2NAAdsthBgrfdqQou4u2Nowk5S2VlSqPxgNvTvUPtTdLfNdPAu9yhIREWa68PaW6 H3lQsFNM5qj7GhiIbQ9trw7NNx8MtEKbnNcNBLzsfHrABkKD3NqPB/oyutK7Du982bin qGLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=QtXo7eD9excPf433931+cz+8Qs1v7ryjcIg+fUZzvcE=; b=MHABjh8qqsK1UTX2K50I7xl+FgcS+MKxAjDdK5u1nD8QmW++8hY2/FTpJYs3Tt9Whk KxVoAWOy/rz7CuP01plOxJ6rmJhmzfWS2fYDYiGeqxWGr/pfULMOFIj4kZKkN/kZr1Ym d0+Kwi2HL8XsiuLnydsd2ToPvbwtin9UrgZkc9HJqYPdQM/YTZovA9wJAP9elgiU4JN3 D+0e3szVxCkRouX+htDO/s6mw95wGfjvSP9FEZJZV8dhkPTBn4hd7N+xBcFDmxfeCcoF mNOtxnuqtf23CXa3CrsUAVUcuiFB1wWbWVkB3EmXtbs6E8r2vrRjSbGtD4Q5f1S2ks2R ngfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DgZBpkIF; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr19-20020a170906d55300b0072b9b9820afsi16456306ejc.845.2022.07.26.11.07.45; Tue, 26 Jul 2022 11:08:11 -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=@gmail.com header.s=20210112 header.b=DgZBpkIF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239319AbiGZRa3 (ORCPT + 99 others); Tue, 26 Jul 2022 13:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239220AbiGZRa0 (ORCPT ); Tue, 26 Jul 2022 13:30:26 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71B6D13F0A for ; Tue, 26 Jul 2022 10:30:25 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id c13so7244821pla.6 for ; Tue, 26 Jul 2022 10:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QtXo7eD9excPf433931+cz+8Qs1v7ryjcIg+fUZzvcE=; b=DgZBpkIF3DWZmzRvdsg0CG76bXnbZU37Soe5JWaax+s3zJ8fbqXqrRDrdgk9gPw5Bb Nn7hQ2MDEN22iOOZwmkfp5WRhSZk1wGS25/uvUuSAx9qjxaAFjf/SuJUfSoDnw9/FSU5 uD8pptjgGPZqKHs63xneTc2H4mwqRvRnrTXj7KxjsB3KRN063sn6F3s/eEk7R079c9el gT7AEMQ59kmfWE//8FfzRhJc+wyKKwZTAuCzewyNMg8G5KUfBuEeotKAzWYO00gwni18 Mrjy8KZQ4+pRyQhUADJfPZELEk3vpz17UyUm5vRr+YKLrBD25jX90e5Rkk2nCScgb6zD kyWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=QtXo7eD9excPf433931+cz+8Qs1v7ryjcIg+fUZzvcE=; b=l+VKrO0a+pWZApRmjPMCmaxKCGHfNpY+T7MFO2yp7KcTpXSjCV3k8qgOFB5pc3Avy/ 2R59uW3n7iFty0g4F+2Wa4Jd29WZGVgpKevhdIpLkOPDQIsYtq1ilXznuvvWtINwopi9 gm5UMru1XmUkt2IYj1JbNt4o6t6gqp2a/7V2AzT64UTj8X4mtsuEO1GQIMhB44rde3bb RCrsyJFrtNzCopXUda/GRGK5T+TppKdwQSpRK92pMCEN1kQk9uTuz5a0iisbPTgq9z6p r4gWPg1BZZAdM3fOgreJ/t6DMtdI0KFu8QvLJ/lbzfeITIVVqkYK81XYppoX5ep0/JOh lbCQ== X-Gm-Message-State: AJIora/FFUgctSL+Urf1L/KuJYVWKbZ1azIr11aUilisnfFniRC12QOJ Vsayv+5uo8nOXms857AtFgJDvDtJuK0= X-Received: by 2002:a17:903:1302:b0:16d:300a:7ff1 with SMTP id iy2-20020a170903130200b0016d300a7ff1mr17731959plb.3.1658856624647; Tue, 26 Jul 2022 10:30:24 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:370d]) by smtp.gmail.com with ESMTPSA id k17-20020aa79991000000b0052090076426sm12344518pfh.19.2022.07.26.10.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 10:30:23 -0700 (PDT) Sender: Tejun Heo Date: Tue, 26 Jul 2022 07:30:22 -1000 From: Tejun Heo To: Valentin Schneider Cc: Lai Jiangshan , LKML , Peter Zijlstra , Frederic Weisbecker , Juri Lelli , Phil Auld , Marcelo Tosatti Subject: Re: [RFC PATCH] workqueue: Unbind workers before sending them to exit() Message-ID: References: <20220719165743.3409313-1-vschneid@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 Hello, On Mon, Jul 25, 2022 at 11:21:37AM +0100, Valentin Schneider wrote: > On 22/07/22 19:16, Tejun Heo wrote: > > On Thu, Jul 21, 2022 at 02:53:43PM +0100, Valentin Schneider wrote: > >> > I think it needs something like task_set_cpumask_possible() which is > >> > documented as being usable in (raw) spinlocks and set the task's cpumask > >> > to cpu_possible_mask and let the later ttwu help migrate it to a > >> > proper non-isolated CPU or let it keep running. > >> > >> I'll see what I can come up with, thanks for the suggestion. > > > > Alternatively, we can just kill all the idle kworkers on isolated cpus at > > the end of the booting process. > > Hm so my choice of words in the changelog wasn't great - "initial setup" > can be kernel init, but *also* setup of whatever workload is being deployed > onto the system. > > So you can be having "normal" background activity (I've seen some IRQs end > up with schedule_work() on isolated CPUs, they're not moved away at boot > time but rather shortly before launching the latency-sensitive app), some > preliminary stats collection / setup to make sure the CPU will be quiet > (e.g. refresh_vm_stats()), and *then* the application starts with > fresh-but-no-longer-required extra pcpu kworkers assigned to its CPU. Ah, I see. I guess we'll need to figure out how to unbind the workers then. Thanks. -- tejun