Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1737759rdb; Wed, 31 Jan 2024 07:41:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGq6Av1ND2IcS/BZCtr4wkSPMKGRcu3Wyz59PTHAs/3L1pog+cDguSYdpgBlZ6sK9F+/Vr X-Received: by 2002:a17:906:1919:b0:a36:7a43:989b with SMTP id a25-20020a170906191900b00a367a43989bmr1247940eje.37.1706715694009; Wed, 31 Jan 2024 07:41:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706715693; cv=pass; d=google.com; s=arc-20160816; b=wK1JFY02vjTRc3hSE/25DQ1UvXs287Iy16a970MbpP+LhtUeGeW2nB3mvntsC4VFE4 Fim5vh4I/9wgECk4nj0u6+Ry5Qi8zdtLe6ekRYoSFsr4qd8mnVnJ3yYLG64bZmhNJnST 1s6SW9kE1Ca4jjt/NLhncLaIu37Pa7sLqgVyzEx+aafRwBaNqQkh4RlrJr7mfZ/XCFPl ZVTdjMwjOJvlr6i+5G+xFpApV66zFEBdYu9TG24TEe9/vHZL6LKzWDk2pDPlix2z/2UP sRjE5VBXUO82FKlb2NLbKidJ2Yx5EZLVY2AYnv/bME42f1e4cjkQGodOHYxEbdPkbeRX rmcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ccG+sbCfrbWj1IcTlWOfUc62TgnGl2MOJkfCzt/+H+Y=; fh=MH7m14X97+u4XkDwBwY52xYbYFVJvPS3kFIP5KEPx7I=; b=bJHjwgaVpDjr0lWzp9sOm2UMQrHvp91+IkDFhqh6bQMOsSrO5Xb81ERGcR2eIk036O SWLNze88iOi6AryX+AoidGjNcJeb8qFNdBPVjU1kKsfA4qGazZFDta5WVQpQRu5CkEzL t/F408nCOsRL67pMXBTMzUVmAlnxftI9NS8hv2G9ns8b4yD2/jPL/hlvoddbLsT7038o VSIUkXEiJan5mMYxngeCUGFMIeFGwdaPRfPpMFK6TZEsxuVyVIa++GFDcqAo4pXEsxg6 RLD46oDKsxlOESvn3C8okr0kdCmoyhWqv68hsp5HMg7nTAW7tgM4PH+CERrkcGfWNrRQ QGrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V2++4u9M; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-46714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCU9bZNeHhYCx4hAwQybCg5mOCGAXxDQ2v/IefeWDK1CNs7NHtseJfTKhskmCDLTSW2f2Z/L3ve4R7phQXaNL17A1A9C3B7PldpdCqNN/Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id rh24-20020a17090720f800b00a35dce64af7si2752657ejb.211.2024.01.31.07.41.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:41:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46714-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=@redhat.com header.s=mimecast20190719 header.b=V2++4u9M; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-46714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id C93F21F2AD0B for ; Wed, 31 Jan 2024 15:31:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7F8E12A14D; Wed, 31 Jan 2024 15:31:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="V2++4u9M" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B99369D22 for ; Wed, 31 Jan 2024 15:31:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706715075; cv=none; b=Tuu87cpXfBg7PLMqwVjEny/K5F8HGPwy1CuOO3h6HdLyHEi8LIN5fq3xnXAD7zwbL51A7u1XLDjL7uYmom00/J5upsBmC5+0lzqaRp2bm57FOZ4ojGzAMLMrmvBY6+ZKtHYiec4kE5dU/kRai/ujb6Nm/VigCSxqWfOlw/1I1qI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706715075; c=relaxed/simple; bh=rsDIuaEyL9ScSxFrStOinF9JksJgZ+4nfsKs0xH6ChQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZmwJ0diEoZZUOIbLDXB5ctaT2/XwCB6AQ9d7yosKybn9IQbgPCimId10wsVaIX7IZDk/XI53et7bdxXeM0dRXxn5ACetsT6zTPQYCH5u8u/Bg9cNe7Zr80CFBPsAXV0aBwJZpcBzgX4BN4oAvyMjgW1YpDulervvKM54uvK7Zls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=V2++4u9M; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706715072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ccG+sbCfrbWj1IcTlWOfUc62TgnGl2MOJkfCzt/+H+Y=; b=V2++4u9MeGfRfFrDsuJbTDQp0Gon97ZcDb5k+lodJgHmhrRfwWT25Z0co4k2ULrt23/Vbd 2to/wIYPvR8JDF1AaNy4K9ARZsEncxKm3VNy/LhTGarBF0MhSbu/jEPGkgSMGTHknrbHtp yp8T/ESQ3i0kc7vYb/8phqj2a6IFyhU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-209-vG6ECsSBPqGO5-Sf-ktjIw-1; Wed, 31 Jan 2024 10:31:10 -0500 X-MC-Unique: vG6ECsSBPqGO5-Sf-ktjIw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0BEA93806071; Wed, 31 Jan 2024 15:31:10 +0000 (UTC) Received: from [10.22.18.157] (unknown [10.22.18.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6844492BE4; Wed, 31 Jan 2024 15:31:09 +0000 (UTC) Message-ID: <89927d84-279a-492e-83d3-6d3e20b722f7@redhat.com> Date: Wed, 31 Jan 2024 10:31:09 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/3] workqueue: Enable unbound cpumask update on ordered workqueues Content-Language: en-US To: Juri Lelli Cc: Tejun Heo , Lai Jiangshan , linux-kernel@vger.kernel.org, Cestmir Kalina , Alex Gladkov References: <20240130183336.511948-1-longman@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 On 1/31/24 08:01, Juri Lelli wrote: > Hi Waiman, > > Thanks for working on this! > > On 30/01/24 13:33, Waiman Long wrote: >> Ordered workqueues does not currently follow changes made to the >> global unbound cpumask because per-pool workqueue changes may break >> the ordering guarantee. IOW, a work function in an ordered workqueue >> may run on a cpuset isolated CPU. >> >> This series enables ordered workqueues to follow changes made to the >> global unbound cpumask by temporaily saving the work items in an >> internal queue until the old pwq has been properly flushed and to be >> freed. At that point, those work items, if present, are queued back to >> the new pwq to be executed. > I took it for a quick first spin (on top of wq/for-6.9) and this is what > I'm seeing. > > Let's take edac-poller ordered wq, as the behavior seems to be the same > for the rest. > > Initially we have (using wq_dump.py) > > wq_unbound_cpumask=0xffffffff 000000ff > ... > pool[80] ref= 44 nice= 0 idle/workers= 2/ 2 cpus=0xffffffff 000000ff pod_cpus=0xffffffff 000000ff > ... > edac-poller ordered 80 80 80 80 80 80 80 80 ... > ... > edac-poller 0xffffffff 000000ff 345 0xffffffff 000000ff > > after I > > # echo 3 >/sys/devices/virtual/workqueue/cpumask > > I get > > wq_unbound_cpumask=00000003 > ... > pool[86] ref= 44 nice= 0 idle/workers= 2/ 2 cpus=00000003 pod_cpus=00000003 > ... > edac-poller ordered 86 86 86 86 86 86 86 86 86 86 ... > ... > edac-poller 0xffffffff 000000ff 345 0xffffffff 000000ff > > So, IIUC, the pool and wq -> pool settings are updated correctly, but > the wq.unbound_cpus (and its associated rescure affinity) are left > untouched. Is this expected or are we maybe still missing an additional > step? Isn't this what the 4th patch of your RFC workqueue patch series does? https://lore.kernel.org/lkml/20240116161929.232885-5-juri.lelli@redhat.com/ The focus of this series is to make sure that we can update the pool cpumask of ordered workqueue to follow changes in global unbound workqueue cpumask. So I haven't touched anything related to rescuer at all. I will include your 4th patch in the next version of this series. Cheers, Longman