Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp138363lqc; Thu, 29 Feb 2024 12:38:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVwY8QQgmgp1gcDnAIQ5i5k0VzUbpz7+B3ktXAJAijzf6xX/1G1WvynL9nUh2wmD5tDQbG4Q+QWZtJuQ+IeRMj2jnrjWaL8wlJFFXkIHw== X-Google-Smtp-Source: AGHT+IHG74SkG18cU4oC0J3XJymCT8r+oTRbhtzaJnNRzVoEHou2mY5/Mtl7BfJfSE7t23wYb7Dg X-Received: by 2002:a17:906:c2d1:b0:a44:52e8:9b82 with SMTP id ch17-20020a170906c2d100b00a4452e89b82mr46890ejb.24.1709239082895; Thu, 29 Feb 2024 12:38:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709239082; cv=pass; d=google.com; s=arc-20160816; b=Luq7lJ6DCyhWQxmQVMPbAWbVjcQUS+Nv39YuNVoF8aWpDvXKd6qNB2Ld6HIHOt6NXi VQeJ2QgQqqvDWCrPf673IrMq2LQBy4Jqnj3H7sZP89x2f+p+XuJOKl9pw5luLyie61MQ HPRWmKefLNXN30PpMxD2euvZocJhE/lxJs6WySPCEXsR90xrPCQlMtgG86LoguOeJauA YrV95h2+eE8D/x5fnqPAvNihrQY2gIyJtEbSiALG5g9mflY9L1JYkPBHzwK9AW14F4bV aHi1ShUZxrWaT9/LtDkNf9PKfpF6UJKMYAKfMwQ0Ol3LmQWFeHccZuIAdjs6NPbpfIPb CdVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=i5blMfwCgLp1FPPnA5HDVy206wgmfNgtw944me58i0A=; fh=nrHfChaCwynMzqZU5FihpKwN9UVn8GWZbCS3t3MOC2U=; b=wpiSect1bkD0i/zvQsresG9mO0KO71xl/qwfpdUlkG1YerHCn44Z6yc+NnxizIXdOD Becd1cqbzJe3jJFQGlbd0NTtuRLXGL3LrQrZWtgYnKnJ5YKc3e7KNRQPiKEV5QSRZ0oL CjIrIgW3FfRcqk6FcW/eCRn13+qSVFKjq+E+gWws5CwSjZ8eabZQjWkQyhvE+VeG3HLE OJ3O/1kYVoOWNNsZEzlKEee0ICv2oKI4ibAeWvGXnQvaQlLZyecXyvz2Ig4DOBZQcGDt 7xyuZLNGof07Jvk50QnEAUJq0Y/XoMSk60dh4TxZgKpZz7r4ORS3ObU+rHi+dRVeseXA OqUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cxsy7Um3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87434-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87434-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d24-20020a1709064c5800b00a4415c332cesi820009ejw.66.2024.02.29.12.38.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 12:38:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87434-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cxsy7Um3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87434-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87434-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 92A081F24023 for ; Thu, 29 Feb 2024 20:38:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C47BF14405C; Thu, 29 Feb 2024 20:37:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cxsy7Um3" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89E6A1428FC; Thu, 29 Feb 2024 20:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709239053; cv=none; b=a7jnnRGukkYjdcfw2iNXe2IcB0SpRnX4mePBTNcJbpYzFZBLdVb9GHdOyTjimqQAXT+ywH1jXnJBQlpjHYxQmeovedrVz9PIF6TgFhCLeibURvUUaQNrUaWExSuHOSmSKPi5uZGL5m5UhKWSa/SuowLuUvwbLPRKtIrahvzWqkc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709239053; c=relaxed/simple; bh=ii4D7YiCreEVMR4r5RTvfhi7WZ6+lvbN3NGPlbGfYUM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CMys/j2UClzr/S2bsuj5Jw49J0KjB89bqSTei6KHe/kXSPMtPs/HszncR1M3p4jaaVQnPd8xi/JusrijgoQwizuEX5Mvk0JxPWDALoIVp/o5YY8XIScsblrKkAUJ8ndHKjL9bh30GOtoJO/MlTdZn94oxaaYEwpBHPeA1bPoBZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cxsy7Um3; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1dc96f64c10so13739325ad.1; Thu, 29 Feb 2024 12:37:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709239051; x=1709843851; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=i5blMfwCgLp1FPPnA5HDVy206wgmfNgtw944me58i0A=; b=cxsy7Um3pV09VqTA9KVIG9RIW297u9aObGYhimN9F3l6bWl2/9wEsJfuuKw+pGWuSw VZej06F3BjGz6NP6vsFG1NqtgZGlDb51g+AYQWsALsjVDZLpCwpQwuFdkguP6V43MKFH VP+5yKfDeTid7GiosH1uZdI7FysPvTQs9W9pH6F3L/1u1be/RSjJPoBy+l+ytEx7FuvJ eTJZNPdkjU6dWrivxvExMXZQrePH/Yo2zOpVgyLK0Zvwcen2DDoyaymGt49kqfDNyYMy lblfXP9uLlVCHqIQdiybBHd7ldiS8691qfTONlXrKTwTuc18LHTnRVMNQsoKITV5Ld+v WjZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709239051; x=1709843851; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i5blMfwCgLp1FPPnA5HDVy206wgmfNgtw944me58i0A=; b=Ln5UDKbzHR7gVcO3OuFN4o4Z++p59+h21bJiUV9V7vAVR7KE8m2aC6RNJSM/+VJWvp VWN0vme49FnixMZpv+k6VfK/wLQbgEt5LRR/xwGU0A4Z3rp2Zg6siMWQpN/tZ7Ajkcto GvraDrbgZ74cK9/dyGBZ9pnUC13aQytc9uucM60b8F3ib+eF85sM4shIQ7mOitBaYaD+ UOa+NLcyp0HVuJoWRCE18wbu7NAUdsLt7MBu7MaDvHTJRx5tzSLeUWdvLqNVtvRdnvTt kFEDimhY3o4KzZZ85tydz68+jX6Q+ER6lhTK2TtDi0Fg9tGXbLHtmnf9oFWWEBTUBGdK rZGw== X-Forwarded-Encrypted: i=1; AJvYcCXkJxk2JuLi1aw3d3CIqBrBC9QaP07g3LYQxCCx609IYRxkUahyfmluhzPc0RRcZ/CyARJke5d64seUMsVrWQOhJcLjyGA1Y9W3NnAY35CvPskp5lw0lrh7s+0gPtxZC6rpynpE X-Gm-Message-State: AOJu0YxPYdG3JjYdKMMC5XBwZ5gySF+GV+AyYoE1R5w7v7a5Nvd2yyEe nFzOLksqcLMR7H/REgdSexTBg5nQ1kGVH0SQzWUd4QyoiJjCTDg0 X-Received: by 2002:a17:902:c403:b0:1db:ecf1:3b67 with SMTP id k3-20020a170902c40300b001dbecf13b67mr4292849plk.66.1709239050771; Thu, 29 Feb 2024 12:37:30 -0800 (PST) Received: from localhost ([2620:10d:c090:400::5:8305]) by smtp.gmail.com with ESMTPSA id y5-20020a170902ed4500b001dbb06b6133sm1920015plb.127.2024.02.29.12.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 12:37:30 -0800 (PST) Sender: Tejun Heo Date: Thu, 29 Feb 2024 10:37:28 -1000 From: Tejun Heo To: Boqun Feng Cc: torvalds@linux-foundation.org, mpatocka@redhat.com, linux-kernel@vger.kernel.org, dm-devel@lists.linux.dev, msnitzer@redhat.com, ignat@cloudflare.com, damien.lemoal@wdc.com, bob.liu@oracle.com, houtao1@huawei.com, peterz@infradead.org, mingo@kernel.org, netdev@vger.kernel.org, allen.lkml@gmail.com, kernel-team@meta.com, Thomas Gleixner Subject: Re: [PATCH for-6.9] workqueue: Drain BH work items on hot-unplugged CPUs Message-ID: References: <20240130091300.2968534-1-tj@kernel.org> <20240130091300.2968534-4-tj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Feb 26, 2024 at 03:38:55PM -1000, Tejun Heo wrote: > Boqun pointed out that workqueues aren't handling BH work items on offlined > CPUs. Unlike tasklet which transfers out the pending tasks from > CPUHP_SOFTIRQ_DEAD, BH workqueue would just leave them pending which is > problematic. Note that this behavior is specific to BH workqueues as the > non-BH per-CPU workers just become unbound when the CPU goes offline. > > This patch fixes the issue by draining the pending BH work items from an > offlined CPU from CPUHP_SOFTIRQ_DEAD. Because work items carry more context, > it's not as easy to transfer the pending work items from one pool to > another. Instead, run BH work items which execute the offlined pools on an > online CPU. > > Note that this assumes that no further BH work items will be queued on the > offlined CPUs. This assumption is shared with tasklet and should be fine for > conversions. However, this issue also exists for per-CPU workqueues which > will just keep executing work items queued after CPU offline on unbound > workers and workqueue should reject per-CPU and BH work items queued on > offline CPUs. This will be addressed separately later. > > Signed-off-by: Tejun Heo > Reported-by: Boqun Feng > Link: http://lkml.kernel.org/r/Zdvw0HdSXcU3JZ4g@boqun-archlinux Applying this to wq/for-6.9. Thanks. -- tejun