From mboxrd@z Thu Jan 1 00:00:00 1970 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 3C218187F for ; Tue, 13 Aug 2024 20:24:03 +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=1723580645; cv=none; b=VdNRGCflZjRLJzsBanym1YSP/+fHjjWN6iNO450L2BLCKJkxdN3OU7TQjtkOc6HPnXCQsMZpTaRCGZgxYDZdyZHitR9BGLOrfdHArTIAia4Gu3f3mdBUMMTnRxqZm0o21D8AaEe8dkWgwnwubja4fCUJGtajpO51zbs40MHrJk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723580645; c=relaxed/simple; bh=cKzROu2rsXWjPByX6omphwInN7w+SBFfbeXY9ytsO0U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lMZmLql/yxcSYc9Sm/er1fVMbEPkuzqxnZ5NxnaWoKYUsgfRgPNWJ2uP+Ljw2ADPoQ6SSn8mXnJlZ5NSril3e4mNolJWIIctblRPfDdxFGCPiQiuRvEa3WMe+kshXpgYprmwFGS7mrTPzGKxz63ZNMBd/4Tt+Me7WxqG/hOHMDY= 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=CcAg8nMo; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CcAg8nMo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723580643; 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=cKzROu2rsXWjPByX6omphwInN7w+SBFfbeXY9ytsO0U=; b=CcAg8nMoy2FL0bDN+4VH2kRgdQx49J4AnNef+wyglEEHG2AuWLRzH1svDGnLYdSBEFZ8/Q iHqHHOfUxd5hffjYtO3PHj+MIqMeeAYSk89mItXDmN8ferq6ab7AlNbuUT4mcMSMX/IIkT awBMj4frdveNgeQeN8LgSL7GGI0YU8U= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-211-8CRdScAAO8SUR37vuXI5pg-1; Tue, 13 Aug 2024 16:23:59 -0400 X-MC-Unique: 8CRdScAAO8SUR37vuXI5pg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6FC011956080; Tue, 13 Aug 2024 20:23:57 +0000 (UTC) Received: from [10.2.16.208] (unknown [10.2.16.208]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C07F19560AA; Tue, 13 Aug 2024 20:23:54 +0000 (UTC) Message-ID: Date: Tue, 13 Aug 2024 16:23:54 -0400 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 RFC] Avoid memory barrier in read_seqcount() through load acquire To: Linus Torvalds Cc: cl@gentwo.org, Catalin Marinas , Will Deacon , Peter Zijlstra , Ingo Molnar , Boqun Feng , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240813-seq_optimize-v1-1-84d57182e6a7@gentwo.org> <183ee6fa-1d42-4a01-8446-4f20942680d2@redhat.com> <5d54a189-3c2b-440a-9626-4e00e95a7f77@redhat.com> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 8/13/24 16:01, Linus Torvalds wrote: > On Tue, 13 Aug 2024 at 12:58, Waiman Long wrote: >> Sorry for the confusion. What you said above is actually the reason that >> I ask this question. In the same way, smp_rmb()/wmb() is available for >> all arches. I am actually asking if it should be a flag that indicates >> the arch's preference to use acquire/release over rmb/wmb. > I think that if an arch says it has native acquire/release, we should > basically assume that it's the better model. > > I mean, we could certainly use "PREFERS" instead of "HAS", but is > there any real reason to do that? > > Do we suddenly expect that people would make a CPU that has native > acquire/release, and it would somehow then prefer a full read barrier? ARCH_HAS_ACQUIRE_RELEASE is fine, but the help text for this Kconfig option should clarify this preference as both the ARCH_HAS_ACQUIRE_RELEASE and the !ARCH_HAS_ACQUIRE_RELEASE code are valid. Cheers, Longman