Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp156673lqc; Thu, 29 Feb 2024 13:13:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU+krv/+YQfKl6oGxd8EjwB3mupuNfNnqaAwe4fjz26ypIpiFr51ci33mrQSheTm/MjpiIJmXl+P4piIz5a5IGnjpYitaTFEBV9zQqCrg== X-Google-Smtp-Source: AGHT+IFaE4kWYPwytooKIkQPO6etCH05vJXaZnm4HoS4Tk66UfM1qGo7r+3YOM9oFvbRyWsZRK1p X-Received: by 2002:a05:620a:a91:b0:787:f601:2fec with SMTP id v17-20020a05620a0a9100b00787f6012fecmr3397206qkg.24.1709241184988; Thu, 29 Feb 2024 13:13:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709241184; cv=pass; d=google.com; s=arc-20160816; b=ANI3obrp8mHm4OObUwaHHCZBQhcnNI/qd87mPVQOWsEn+CfHUxgishF3VWRqJ8PRhu KP85FdNZQwDBOlTJWHyCMdPYZOpiwbdoT1ll0jEARP7lzPRGN9O0EH/1VECChRJ+dmPE MyKTc3eKGHWMeu1thatCMTzh3i+/KtmlN2+6ylgVCqH7XnwXO2NkW6uJTuHoiYjD0D9t pugOZ3MJaHAKchVZr9dc6oZyRzM9pZ7VF0GZucftEBIWIbXH6Nlmq96BVL1M5+2mS4LK I1w4k9xqNcRL3aWIakIgWPU9PMhlufa/fZ6xanoCD/XCKt4pnKJzhZv3GBcc7Yhkflan gBFA== 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:feedback-id:dkim-signature; bh=EzIxZF8ZIEwD2OTEM2JEqlEHNkUn9G6VGUCr6uISdK4=; fh=OsdrA9hggublNjeFz3zadNlxcITrQnxr/f9ffK7DFZI=; b=PfOHTj5kP1//4KPnOS7lPfYEAjTtLp/Ku2qCBCiqh6m3pIobitbLo28/SSiWb43GvC MJOll7lMjWKvsX1ZopwVu36SY95jQU+S9ae76TNU3vggOpNpJJx3fQHGeUbttvSZbFI0 87VNG8N4hBpBq4olk/Y7z0q+klypmUtOItIjULuDdXisWYCBlkp4V0OcyYUD9Nw8yFmn 46mogP1R5ezmv0+CGq+fkXzvJ+WqI/0hUs0rs2DxOPVrIw+hVidxtv+b++PKrkrH4rR6 hbpku8x131iK8+XjrJnhG/VjVmDNWJkjfTGVzPIVd4gVpuV08hBgeGr1dcgSMukn0E3Q KcYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=m9DYyfyA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87560-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t20-20020a05620a0b1400b00787c17ee7c4si2172761qkg.271.2024.02.29.13.13.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 13:13:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87560-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=m9DYyfyA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87560-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5094A1C23CF1 for ; Thu, 29 Feb 2024 21:13:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5156713E7D1; Thu, 29 Feb 2024 21:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m9DYyfyA" Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 DB5506D53A; Thu, 29 Feb 2024 21:08:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709240892; cv=none; b=bfIZ8ze8FCu70kwLBubStrjXmNQ9FwsV4C5SNn5XiHLSkQBLZJOiP2T/EATZ6h7aj7euENrqkWfUU+YuvmisU8VzN3z+uMJDopZG19vRpYNjlKqQt55ua1aLZ6Kc1lmtNZoKljnddHIdu3RrultrRT4rfZU+a80gSgUtbGRq6v4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709240892; c=relaxed/simple; bh=BVoEXyJnWOjPf9N3vsI8NOsWHEJGIkMDpIW0yRsXLAo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K4zw0hIYm4ZCknrgX34ucleFh8l3DIQYFN/QHLCSLrKwiB6y1u7ynXGdL1+bZt4O9B9k3IJxXTvaWI8AFAARpQZ5Ad2zWkp/+WeWluenS4n/+N2/7nDsN2JnOa7WyVToLAEoBr13lJRSPJ+oBw74mCbnJ3ugmYb+RHKahLoBTGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m9DYyfyA; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-787a843003eso92843885a.0; Thu, 29 Feb 2024 13:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709240890; x=1709845690; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=EzIxZF8ZIEwD2OTEM2JEqlEHNkUn9G6VGUCr6uISdK4=; b=m9DYyfyAutfYeflUm2oEeEAk/qVk3HdZ6SJIjbmXZ2+dVgS9krCc4bJQD0zll5tVlW n1G4tqbUqr+N6p03rtTVLHC57d1scoQ7Q9UMZ2QQpnYPdJHUv16K0I+rKN7knOdCqsom EfrRloZ103V46HQwJJUlX01PpuOrUWcC+fGqlUrlJGsImxCTz0CQ6KL99aFUCjRyepU+ xkmafBoql7FsUVI7ObbleQkqj6PKtZbmdNq4PiyNFdik7L/kj6exOUhh3IARFTepO0AF OwcUbCB76EX2C7iEINSg033nRYcqnpuyInPyA5ec7FKlY6YcqnjRhA/aLC3yiOsbhWy+ 3Daw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709240890; x=1709845690; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EzIxZF8ZIEwD2OTEM2JEqlEHNkUn9G6VGUCr6uISdK4=; b=mHk4vsq2D/8ys/o9SASw7/jFIHmjy/Y8FrvyBMPLHlZ2Gz1z3ZvRURhvYG794yi2I5 9QnGJHAprT2tpE0hca+IzXRbrRNQ18aMctBdHGCSqNdyyzjUw/Azyx4cZ7vFN53lIcoA mnAOPISUskhH6BX3v8Tk1xI7RSJFbwHy6sXPlNWa+5OMm0jAx7yaZDpWZcBju8BbMFsb 6I0Ofa51qcvY86wOMilKS3lcm5hnLf2uX2aVq1v+RL0/tWrphckTvJZrdExTkljJAlRn zyZzDPhJnEBJ647myL8YgfBOGW8L9ylC59VBaVIr3dRvAsQF88QTYyYP1oENN8lH2Jzc FinQ== X-Forwarded-Encrypted: i=1; AJvYcCW8KMHA3mF+GUCIo6q+E53GWco5TB2Iay7Ld+rcy+zNSySAPUCry4n11E3B9+hj8Dnd6d/76XvrtPjEW9NTgs7ffr14Uz1+lgmg+yti9jYORTMq9soPOQZMAh/b7XXQohMsjWTj X-Gm-Message-State: AOJu0YxdKC8Pev6t0Bf+DTEOrL6/TVq8BlDudcu3geGO8nNI2EJqBubf AM8bT+pMBBCzq0tKVeun+0PqhhdzgLh6ly1g1eLBdIdM/ZOQrD71 X-Received: by 2002:a05:620a:4ada:b0:787:cecb:626f with SMTP id sq26-20020a05620a4ada00b00787cecb626fmr3415801qkn.70.1709240889831; Thu, 29 Feb 2024 13:08:09 -0800 (PST) Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id i7-20020a05620a404700b00787fb9e2d2esm979317qko.125.2024.02.29.13.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 13:08:08 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfauth.nyi.internal (Postfix) with ESMTP id 4CB5B1200043; Thu, 29 Feb 2024 16:08:08 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 29 Feb 2024 16:08:08 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgeelgddugeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghes ghhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhephfetvdfgtdeukedvkeeiteeite ejieehvdetheduudejvdektdekfeegvddvhedtnecuffhomhgrihhnpehkvghrnhgvlhdr ohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 29 Feb 2024 16:08:07 -0500 (EST) Date: Thu, 29 Feb 2024 13:07:21 -0800 From: Boqun Feng To: Tejun Heo 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 Thu, Feb 29, 2024 at 10:37:28AM -1000, Tejun Heo wrote: > 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. > FWIW, Reviewed-by: Boqun Feng (I took a look yesterday, but hasn't gotten the time to reply..) Regards, Boqun > Thanks. > > -- > tejun