Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp11223lqh; Fri, 3 May 2024 11:41:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+TebFU+LW8P9p3NspnoZLxQsprZVqpr5f3vtV86Um6d8kypIbK1wFTGAXb950bp2kgW9ennNL4ZhhTsNKoddgrSVMi2W3Mra8/lkxKQ== X-Google-Smtp-Source: AGHT+IGaoefdPAR5DPVqHGa3WqUhVUpmdG0y7PoP6Am3h+T/tOo382ajYqFR3OWNrEZd0PRhxEh7 X-Received: by 2002:a05:6a20:2d14:b0:1a7:8828:bca0 with SMTP id g20-20020a056a202d1400b001a78828bca0mr5343532pzl.3.1714761708240; Fri, 03 May 2024 11:41:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714761708; cv=pass; d=google.com; s=arc-20160816; b=Ipxrfx8wu+fW7k0OwF6Mlxy4vH4xgLq/prgrlRT1vc02wgJ/Q1XBUhCN3fQej0Yprb WdlolYzX7ERlqOfQeLQ/oDTPMHYnJUSHVBdWTI8B6zKwEmA2k1o/G9GHNiq2ha1R6Sxr qHNrf4w5NnDxRqL4ViGqiFLsZE5IxxdxepRK9aE2Al8vbYNnBBlJDkMbVgCYBp7Ek1cb 3UC2AsOb+JkOfHYf9idBFT4GmGzl4j7S8UCTbaR06Lfv3HBHyHN/WwCj9b515Tj/l2JM lGI0jqzYlr1ZXXaRGee8Fh2qiLTWG5Mjof4u9AziqkJ+T0OzkLNEyn23aaSONIl/cLoa d9Xw== 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=bQj6b6uzNq4Run0h1mfKtbYDm8JqGmwqI0puPCQ5+lM=; fh=wjXYxQGA3Fy3PrpnAZC4BwqSRmUB0UdVbz+8L9iXa2c=; b=m4cQuAQrmD+58vfdD+HqeyEkZTsJ6Em6Xsdiad7M+TMILxDArDQncDLxBqXOweskDy hgdSJgvGgs9acLw9Qpk93QsGwNgsugJuHeh/Vp3aWEtTdwJWCaECzbcGboM4rEos/ssk F2B4ZD0MW23+j4niS7D5cIUJT2IfRH1XO0o2C9HzLGcQzYVIOvZEuChA96oF/8hLrprW Qc06mMergxNYC6JAi3PNc26VBw2ylGRv+mpC/KmUu5p5NFAiZ0bNvkx+xvkOUMnDC1hG mvct8hmNxyb3U1ddx2I1ocGlMKfIuwkiK5bkiBNIl6f+IYBKvDuUQ7nj4lnaezdvU0AI k7oA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=Eee81c0C; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-168077-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168077-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id hu21-20020a056a00699500b006f44bf08609si1686835pfb.251.2024.05.03.11.41.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168077-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=Eee81c0C; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-168077-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168077-linux.lists.archive=gmail.com@vger.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 DBE8828404E for ; Fri, 3 May 2024 18:41:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D00D1EEFC; Fri, 3 May 2024 18:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="Eee81c0C" Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 1849E57C9F for ; Fri, 3 May 2024 18:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761702; cv=none; b=KaxGzMTiis49iy7cIZMCaaLp1M8WdXqYAwjtYzbak9CjUdfIexEALfSezZlQg/ZYdCj0GGGplWdXw1vKCWONMh2XKZZfcsLgRHW4xpPTjZyzeEJ3FORCdZb+6ytSAYelQXJu3c1Ex688tvYzCTsjrMIvNveq4Gxtng3x6GiUs88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761702; c=relaxed/simple; bh=71pjptQeomC726ly7T7i6i2tgcntzZ5e4dZc/Q8d4b0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NWGgOIpH8qNv6X7izCxwrleEaRXANiOU2MxCaQeHRTzHMd5Mk6tkrleQ6O7TgYLFsMZvuGdFmlSTjAmakLRVu63JGHkEeRzDniNi5ovjGYEAyj6XjSfmXtsdvCPGq3d5CNXh+mbsucszHm38j2IF0OJJ0Su/auEZMMCWYUUvkro= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=Eee81c0C; arc=none smtp.client-ip=209.85.216.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2b360096cc4so9344a91.1 for ; Fri, 03 May 2024 11:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1714761700; x=1715366500; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bQj6b6uzNq4Run0h1mfKtbYDm8JqGmwqI0puPCQ5+lM=; b=Eee81c0CQ28YL/GsA3aCRcvkP8wuyUDjkgEhl0iziZkVJe5u7oAOthLa6LzBIvKcQg SGF2iXSe35mYfAtSd9Owadth7Yf5Ji5LoDLQWIl4vL/+4TDaGpWEg0oudp1Hj5kxrtwn tEXJaRZOMJ4VgtO29yZ0qZoxXFp6SSjYFgvJ1ZoiQuxqi9ixlIPUGwAk7+DCn46DQnbt LlgE/+eNrMHF2cvuWFrzg/lq3WRsJLj77h3pCteyWRPcYIDzUcsuj0ZUwpPUMeiW2Xan wyqyfEQWG33ov5VyPRgpjaeB9E8di1FoC5F0Gvr4/cAivYoV4LgParxfS2vnOhkt+RWg lUow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714761700; x=1715366500; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bQj6b6uzNq4Run0h1mfKtbYDm8JqGmwqI0puPCQ5+lM=; b=mWth9t9HxN89P5U2+k2tyAgdrBpgqVVfjn2ZWwRVKADD+ScA/C3yKyAL78d5wf+TV8 v/fPmjPeiAUJHcZ5ArYn7wp3wiSWkEYBLJW1nQ3fiVWGFgOf1C57BcHhd6osOZe/EgmW 0+GNnFxQx8Yh7KG9FY4jCeiGKbSstXrcOsW7aN8X2u/g5mHj4cHGft6m50YdCKuWJf+A OCb6i5/eotdE91hxjRCmmXthKFVv5kxu4zhuhrMI+eJTe6GbxzDxM7qI7rKfgLUimSGE 6P+gPWx2lqzJxLDfsAQVG7//amzCWuRsLZeN19EqPot2P2gRCAjmw/CmgUaRcN0taxPx tG0g== X-Forwarded-Encrypted: i=1; AJvYcCUcPFuKaXppn6yZ2dmyrgaPsSmSJP4ck5MxzwOrOLDpa9fLXF7GwmsvsX6W93J2pJNpR5SKRx+k+NWj/Z5wrqN8y2irV2QMraSSxQVT X-Gm-Message-State: AOJu0Yw6j7TlL+77H1MCEkPQHs2jVfphKsZulxKxBkRLkJtW/0xeMAFi oneuykUhqjvcFiCI6ymi+f0E3On9M9lLsEZRr4lYi0e1122oqk2uqRRIVPCTPfs= X-Received: by 2002:aa7:8d82:0:b0:6f4:4021:5596 with SMTP id i2-20020aa78d82000000b006f440215596mr3473710pfr.3.1714761700032; Fri, 03 May 2024 11:41:40 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.194]) by smtp.gmail.com with ESMTPSA id c11-20020aa7880b000000b006ed045e3a70sm3378730pfo.25.2024.05.03.11.41.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 May 2024 11:41:39 -0700 (PDT) Message-ID: Date: Fri, 3 May 2024 12:41:38 -0600 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: Breno Leitao , Pavel Begunkov Cc: leit@meta.com, "open list:IO_URING" , open list References: <20240503173711.2211911-1-leitao@debian.org> Content-Language: en-US From: Jens Axboe In-Reply-To: <20240503173711.2211911-1-leitao@debian.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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. -- Jens Axboe