Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp34800lqh; Fri, 3 May 2024 12:28:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvMCR8scvO7i/mFX2tfxElwcdZ/IPg5iMtuNa/eJAPJn7JsyM8PcVtVf2c5i5DBFziFeteGMhCcT3sLnwvOq1j32D9+5DMze+DwmcwIg== X-Google-Smtp-Source: AGHT+IHAnag14VqsdkOa9gTF1HdunpF2fOdT1cn86QWo/CR/6UU3yYsXmMNffo7dyifBXhiuCyjP X-Received: by 2002:a05:6a00:2d2a:b0:6ed:1c7:8c65 with SMTP id fa42-20020a056a002d2a00b006ed01c78c65mr4258446pfb.10.1714764516642; Fri, 03 May 2024 12:28:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714764516; cv=pass; d=google.com; s=arc-20160816; b=Ns6f994TBDWlbynhdVykLarbeUpOr5IeSU7+1OA4vRe7KVs2eMAZHxyeVGl2pNxZxo dc6hERtnpkh/TPkGyxvaK/Vua8h6TzpO8PYYMh3YCzKGpEQ+vSvO2sH2pfR+j9kapSNd Rdldh3z8HQ5j8a77o+FQPzTMcJYZoCWOhjTWzZ+xLua4EafCX8TSCtupDAZ9y9I1HfuW 9943OBlS72Z6ElcDxe0NFPPruts8x2oJGmLuCdpvrmqEF7lQGujoRBMNtPQFDh1I6rH1 RkOr3oFDjvxGHnsUeAsii8L55Fa1AEatT1/xlcxOAsSkgWYsQwyip+VivKzpcH4kbcZz Vp2g== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Res4pHMGCSsBjpzueSYAGK/V8Lb4XzdEaIsnSoWhc3Y=; fh=fYp92T080eT3S9P/gNd671kpc26tjMY+/LTHJclYkqE=; b=ahEiKpAquZHVBdGXo9F6qQGndSWuzxgFA1ZptLrb4ulmzmEAvcs+dNkIpLaMkXWg/O F8V2jutKN4L6xAUXJGwchLPhgiGaVmsZ3ArX1esGmnk24S11RPATIdAQ/rOIH3OuyhrD DQX9H4PdX13eirOrx4cXhwUqivvF8oaczo1SnGUHMwMHEzfoRk8yweXNDufrLxUIzf0N jY2E4QCHNXboDiEt0yXC2O3xTOib/LkfCBSAc5e3evrseCcVe6k8iJ62bSCgaAI2xIQj 37aoulrYncf7K14LlWQbHrxLRXr+ZEIQVJXWsDDG2cEGEM8FDo0vT1w0/9mrvtPevMUK hYiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=gp895mwi; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-168118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168118-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id r29-20020a638f5d000000b0061ec242496asi1034240pgn.47.2024.05.03.12.28.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 12:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=gp895mwi; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-168118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168118-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 56AF6B24B36 for ; Fri, 3 May 2024 19:24:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E956158A05; Fri, 3 May 2024 19:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="gp895mwi" Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) (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 AF43C158873; Fri, 3 May 2024 19:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714764282; cv=none; b=T1BGUtEfKtPC/Mb99suigfhRrQp45S3eHnvOERDZJnihQtn6R31TeRnin45kRPpISrWUudT3wDNWgS4E9LKOxjqqfZViutCxQsO3STME91rkV6tmbKRFfUsKPAGaC1wb8x6YGGGaaOXz46vzzPvlY6HVFb/0Bkmk4BoG02WMRY4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714764282; c=relaxed/simple; bh=zZ2FUv8UH3f3a2CJtgWcnJhZ/rfuVISsRtOo/kp2UWE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oSApzknRFwrwu129Fy9b3TIVlBQHqKaOjFyZX9sM1iqmLgjjTE9nLd5Z3K87SFU4/MppIAppT3DdWfF7L1o93oeWdal56m+gM9+6O8uX7rWRXww6vSGiIFre5OF/lZXwsl2SvBvJu2LGwziwQc6PoLvFhOWrjGP122nxHgpxxZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=gp895mwi; arc=none smtp.client-ip=80.12.242.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from [192.168.1.37] ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 2yWEsvHebHa8W2yWEs2JbH; Fri, 03 May 2024 21:24:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1714764272; bh=Res4pHMGCSsBjpzueSYAGK/V8Lb4XzdEaIsnSoWhc3Y=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=gp895mwi1U7sT9E0ch/3qTMi7Ne8IJKV2ziOUP9XRPigPLXdmNk9Slzh9jvh3IRS7 njmnc47DhexbOoSUw1fj1nNcgErhvhpmwndH2eOEhgKvd9rn/wHbImhrtZd+ZOUJky 9aE7AUlgEN8jN4SgP9/UFFooe/0hjEk2X+E1VdASxZ6AzBzl5OemDI8obWIt2sOe5w OrL+NinyAMygQ8/LkRXBlvlXlOaEcO7n9cvGX/ZKqXxjUcMfBLGEgppnJGt2DtHchQ lcHw67cakEm3PzloyaroS5Rbj+TJ6ft9rMlQNnEhd3XEdNr15Pwz9eN7zWzgYuyBaW +1B7TrU2VsxUw== X-ME-Helo: [192.168.1.37] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 03 May 2024 21:24:32 +0200 X-ME-IP: 86.243.17.157 Message-ID: <75ae8634-72ad-4c6f-92af-76eaa1d3b1d9@wanadoo.fr> Date: Fri, 3 May 2024 21:24:27 +0200 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: [PATCH] io_uring/io-wq: Use set_bit() and test_bit() at worker->flags To: Jens Axboe , Breno Leitao , Pavel Begunkov Cc: leit@meta.com, "open list:IO_URING" , open list References: <20240503173711.2211911-1-leitao@debian.org> Content-Language: en-MW From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 03/05/2024 à 20:41, Jens Axboe a écrit : > On 5/3/24 11:37 AM, Breno Leitao wrote: >> @@ -631,7 +631,8 @@ static int io_wq_worker(void *data) >> bool exit_mask = false, last_timeout = false; >> char buf[TASK_COMM_LEN]; >> >> - worker->flags |= (IO_WORKER_F_UP | IO_WORKER_F_RUNNING); >> + set_bit(IO_WORKER_F_UP, &worker->flags); >> + set_bit(IO_WORKER_F_RUNNING, &worker->flags); > > You could probably just use WRITE_ONCE() here with the mask, as it's > setup side. > Or simply: set_mask_bits(&worker->flags, 0, IO_WORKER_F_UP | IO_WORKER_F_RUNNING); CJ