Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp732096rdb; Mon, 29 Jan 2024 17:22:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpvUBYTRDxJ50RnkxdO3rY92SjJtSVT/N3xfHydH8RBzrIXn+9PzuMTXspCAvN4fEXrQ3i X-Received: by 2002:a17:902:ec06:b0:1d5:8cbc:863c with SMTP id l6-20020a170902ec0600b001d58cbc863cmr316853pld.27.1706577763240; Mon, 29 Jan 2024 17:22:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706577763; cv=pass; d=google.com; s=arc-20160816; b=Yx5R8MeU6VkktGE/qIa4CfTnrtHCzzTlx1P8GRDkMTLXQAr3yLL/YjWofXtUhj1H5H oKnIVk/0SNk5OhsS8zCz7BJcy4Ac+eAH6b4SxmioA9CtMA547YVtO6OZtlvqnYwUgkZP pYEdwJ0HFuLfA/ttsCMchTh51rpEEf4z6LmQWFZzgFtHNePqGg7iK9CxC2MCZi4WpZOR QsHzXWdl7UEKG53aWj+qs+qMlsl5o2mVUQMyLlEH1NtpBKxyKljhzmMrDtkA4i5YBJpM gob2zhbiNsqWu6XKqUxApt83lKXAgNZhpKGGsZxrrYRMGMZza1Q2yn+kah0EJdDuFkDA pFHA== 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=wMqd69DzckDwNLFqdbiaLgONDOqgBjB7CTh3HmI3dKY=; fh=NRHDEj5z3+DTzQbODKyiEq2rZDHuauhgTLrVUeiwcNY=; b=RbJE42/Vlc6LytPHa1fMsotJK+eXhuyiU27ms5RSioGll/c67F1LQmWQh+8RLGTqmY /QdTGwPem8lMfRcEHC2muymy1MV5S/qN2+ESYSWaVB3/5J9nzFut1Ewcw5399eRIBIZ5 nMzkgVjFSm4LGi1nbUc3b0DTDrBtUcoPYgQd0S3nomDv/zqF4uLcq2F6KM6EhVcchxpC Pe7pBDDdinPAKnKeyIac++NP6IrSXznptdMKkyypHefUf8M5ABz1tlF+UKYOaYSXSCN9 f5Q/t1pQ/mfAXl1oYcNwip1LHe/7olYljwFjIv9uq4R/RAcex97sQREaNO0S7hOP2S3F tdtg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kFgcvbx8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-43712-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s13-20020a17090330cd00b001d8d5051782si3015754plc.522.2024.01.29.17.22.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 17:22:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43712-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kFgcvbx8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-43712-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43712-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8C11F285495 for ; Tue, 30 Jan 2024 01:22:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6899358A5; Tue, 30 Jan 2024 01:22:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kFgcvbx8" Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 A0F9A2E40E for ; Tue, 30 Jan 2024 01:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706577757; cv=none; b=HqoI3e7QfJF6VlwAqUUyeiAAV6xUtAf3cK6Hq31Fw0EjrXVzTMgHTZeXcRpB7YULOiMfS7HaECIAb8c1VuvIConRe7Hlgt27/CKCqXWHrs9OtBb6syF2n5/bFd4VQ2Zoek98oYeRheCJpSYvFRFuhDQGkcvlDcdDqbNNHT7SiwU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706577757; c=relaxed/simple; bh=bIJb+jgCgGliZshmoei+sz4nV6oBQLlhMTwPO0A/Nuw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fwIX/P17tzDEm3uv0D27ZhuwVrzYeOfIQ8YY+oSlYYD1SfwJWXZptmqvYTJ0WmGLf9LNMUyoMmNaFIA5PSAYekgPlrF0eWeqpp92LRcjAAYyTAvsnNATABmcUNX+DvP6zdMmnt9gLkH0Epw++ZjyxeQKrI2PX2Vl7/t7N0eUeQA= 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=kFgcvbx8; arc=none smtp.client-ip=209.85.210.181 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-pf1-f181.google.com with SMTP id d2e1a72fcca58-6d9b37f4804so3048577b3a.1 for ; Mon, 29 Jan 2024 17:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706577755; x=1707182555; 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=wMqd69DzckDwNLFqdbiaLgONDOqgBjB7CTh3HmI3dKY=; b=kFgcvbx8+paa2yKimA2Jp50X5a6whisgtiKy7JICf/L9w715WdwB95F4TMxTvFIUK3 7o4c0UCPRBuK08trAKfDUgKu9eHe+w7YPf/mE2XWoNUiRPr3sykVAdXtzr2xJVCIPNX5 Kiqd2NGC3/gB58Mq5h23KPAbXF2ibIHhMmb9wapYYbEH7dO5436ERU/6JAkXtk74hFzy sl9II7RgMZDbAWfAr7kllSDWSSj76Ug2PbHmWMrbQBH3gHpebSknsjfgguAYV0EA6bb9 ufEC5KVN+6LKNiqlAY7C/DQFnGChpKZZ9K/8OOGXxplw/WMqMkFPpLGqAu8SsQf8Y4B/ uTvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706577755; x=1707182555; 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=wMqd69DzckDwNLFqdbiaLgONDOqgBjB7CTh3HmI3dKY=; b=dPxByqLVNu9VYkQtsK0/uarlqDQCi2LynvsfnZzsGlIdGIcoCEvya1faVBibkKxuMx PKUdL7rdZojYekBi5OY3RLSrrCNSHJJNjpZwc5Mw9K21HJ+IyJJ7ZM4NpnZIQVN7ZEsu Kqg0IO2UmzggIbj3sQnvFi6YlTpepHnp2yfciPpQfiuQkSYEH5jcC5LDPDoKO8Fh0Xgp WoOR41+LUUk4vju1epXZITZa2JxuAz2v3vgzpTB1zKCcqb/fvNJkh56YnzPhco+496PU GuLzOZi9Ow5r3GXnB5ThvcfJiIQPzFuyin+0itL5ASqjBoYUqbGb0gjak7v7ekt+e4dW h4zw== X-Gm-Message-State: AOJu0YxYP1AKXLlTGyVkrL+BD9Oz3/eODqUUHmqBIJy9It3CMitvJJ+M GVBAxHs/D0N0NDkxpc0kVzd5B/PTu2dnVmSdNKsvmKYgSXhQyQOH X-Received: by 2002:a05:6a00:26c8:b0:6db:7038:fc04 with SMTP id p8-20020a056a0026c800b006db7038fc04mr237282pfw.10.1706577754726; Mon, 29 Jan 2024 17:22:34 -0800 (PST) Received: from localhost (dhcp-141-239-144-21.hawaiiantel.net. [141.239.144.21]) by smtp.gmail.com with ESMTPSA id f16-20020a056a001ad000b006de09d94723sm5813995pfv.17.2024.01.29.17.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 17:22:34 -0800 (PST) Sender: Tejun Heo Date: Mon, 29 Jan 2024 15:22:33 -1000 From: Tejun Heo To: Leonardo Bras Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, Junyao Zhao Subject: Re: [PATCH v2 1/1] wq: Avoid using isolated cpus' timers on queue_delayed_work Message-ID: References: <20240130010046.2730139-2-leobras@redhat.com> 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: <20240130010046.2730139-2-leobras@redhat.com> On Mon, Jan 29, 2024 at 10:00:46PM -0300, Leonardo Bras wrote: > When __queue_delayed_work() is called, it chooses a cpu for handling the > timer interrupt. As of today, it will pick either the cpu passed as > parameter or the last cpu used for this. > > This is not good if a system does use CPU isolation, because it can take > away some valuable cpu time to: > 1 - deal with the timer interrupt, > 2 - schedule-out the desired task, > 3 - queue work on a random workqueue, and > 4 - schedule the desired task back to the cpu. > > So to fix this, during __queue_delayed_work(), if cpu isolation is in > place, pick a random non-isolated cpu to handle the timer interrupt. > > As an optimization, if the current cpu is not isolated, use it instead > of looking for another candidate. > > Signed-off-by: Leonardo Bras Applied to wq/for-6.9. Thanks. -- tejun