Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp650174lqb; Fri, 15 Mar 2024 02:29:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU0nr8V8HNLYRQWBFMtcdQlL9eHmLmMCtJ4wNT/cCteDwVQqb/CzyxT9/poXEIRtM1KZkLQ1WGUGchgm+t3Kd7H+yljW2b8X8REFIf8bg== X-Google-Smtp-Source: AGHT+IGq1VyKECp0e7BZxy97BU47pMC3tq/V7t9KIQSjJNI0JbGplyV2WrvfvmVJgQZPAseWvILP X-Received: by 2002:a9d:6f8f:0:b0:6e6:7c37:9aef with SMTP id h15-20020a9d6f8f000000b006e67c379aefmr980469otq.21.1710494954829; Fri, 15 Mar 2024 02:29:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710494954; cv=pass; d=google.com; s=arc-20160816; b=cWkfGOECQLEvquzplNnXqcYIrunaW+pVyUW+Qj25O9KkLCSY7v3CWa9XTVbYIBCSad x2eo0c6WqV9AWz42zua0S12Aplx1Vk39S1BOisKU5fHeevUfRpVXiR3XVuMQCNUR1d2U EGM2vpTew55JJ9wL6ZfGMMw9sShrYurCM+Ua2xOTITjF9QilOTP33ZGJ32lRxDCYAwx9 JJP6i+GtFbS0qlxoTSF8eZNjTpVbxg/lPIaiedGJU0gIfmJxH9DLBgBQdj5jqAl+j6Ac wCryHB6MV93Y6sP8u5ht9/YPyQyTBvIIvR7JaZUz8XmZxVYGJPpPpsvxfGeVxjxfQ1Cd ilDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=4iUpnvg2lJInUyXSwQRwOqYpvq0Q7ZeBFhxpnTWBCyk=; fh=0umQWHKybQ+5izm9g6oWUIBy+e1+cg4N/9Qmn3GwjSE=; b=UwHg3EF9B76C0vgixhtqEvbepMbZxhrzkF+oAnrbCcqZkRQEr/tIhEOj8Vu5Gcj4OV 8cHuOwBbmzwlcNR6T68dZbqyYYC1BY0HekF2w/5NK/K/dOhh08E7sKwJ4eOfj+v+HsBV gScwlUmOga9G+j4DYsq4Gw1HggRdH7az+ecLo9cFH0LLQFAmN0t8+zeSLWBKEkuc/UFz OD9pRoGKNOBlVt3sbNs2rnd+9ZHdl2+4zHMfGbCP8VNCzCEdCSPkiS1ep/HoOXuqsQzO 8Ods6Rd54RtdwHtbaXSxIgK2lrXPfP+W5VqpUo3moqVWGQKQw6V3nhN8jn9hf0qwhgtz aMSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WA6i7aap; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-104207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g15-20020a63374f000000b005e453195b29si2291784pgn.356.2024.03.15.02.29.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 02:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WA6i7aap; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-104207-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D0715B21CE4 for ; Fri, 15 Mar 2024 09:29:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E8B21804F; Fri, 15 Mar 2024 09:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WA6i7aap" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 E452217C6F; Fri, 15 Mar 2024 09:28:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710494925; cv=none; b=q+d8mZ1zi+xs5Tx8vC9aeB8kzrMeOu7/4zA28v8OtD38Ng+n82Qa+J7mXB6I6clpZ03jUjebzUqgY4YBhBepo1L3KwhrvzKcLu6/3Ueg+w8rtBbdJOGh/1RGWWS/yjev0blVXqEbvkv60nJZasBsTE7nCrolIW09w74Ziog1YkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710494925; c=relaxed/simple; bh=0M+s6FikwHhrPesVLy1FInqzB+lvAfTTtTj2bJfLm5k=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Qe2NB8R5X45E53rcmBmnaLqrHF/Z/OKLWw+6hAv1AfTFmniXdADpXhs4MTXujCrJZTo4TpJuphsnZn4pDn9yWm2gliR+C56uDL+pOTbJt4XMCyF+tFZeBPTTV7nPa7MUaTYRXGmuh+WlPIr8CeQwsCOMtvkG7zu8jnrplQESbNE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WA6i7aap; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6e6ca3fc613so1738323b3a.3; Fri, 15 Mar 2024 02:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710494923; x=1711099723; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=4iUpnvg2lJInUyXSwQRwOqYpvq0Q7ZeBFhxpnTWBCyk=; b=WA6i7aaplKL/fvIc4g+Hf68jjpeykHGFqgV1f9yvZ5bUGJgJ12/pSyEjBoKuLEaqk6 nddOEfNGlvlVOkXZ9bzTEteZEj3Oadn2o2ESdu3zKAACYQTMyChWiNxGgSIngs7ymMS8 8+WkghRDvR/VHslXXTjSz0ckoHDNku+YeevcLCzwNKLUe4e3UWYeZFBaVuoJDzCL7/1X yaio9T5YwLlU3dmF+gNxtWxxWhpbtoP7gCI68+ptnEneag45tteysbaieGXnWA1A4LdD 14hOd6BpIwnGYOPepwdZDLWyBv8gGmlbjiGkGJkEDU2bOieHQE5YQ3011/UhpeW5dKQp PxOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710494923; x=1711099723; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4iUpnvg2lJInUyXSwQRwOqYpvq0Q7ZeBFhxpnTWBCyk=; b=HITg7ZMZwuFGB8bEhK0lMQfO73mNZXhVRV7xsKQgZBns09rFgGe39eAv0Cv6cLn6JX nERbLQxmsSzc8jStiSuRuDPeLGKd/g1ZqfXjfxQXbZCsbUvKsttcGIzoWtKk209weQsk 5rmXA8RNmIpZgjC4vz54kFUP+I/ijFrcTBP96z5+HoxNLLw0ZIC7JyHIawhD78b8nuZp JAIH2Y+gEnNALioJHizChgD3jjhJ/YOVDnTo0JaKlM5VRU7HTo4sKmyzDS8mS0nh4k7G IV8gfKUAnb9PP7YdPgVCpzCl8k5rOxI928nbPWbEq31Qi1xBEN6y6KjA3NJRiVvUsXjQ viQA== X-Forwarded-Encrypted: i=1; AJvYcCVmNI+1psvaAXRrFMcxNLbGM2x8gT6+AbZ/ixyL3/zLzS6zl/VLlwOEO0tBHA9vIQVkF8Ib8EwtA17xt0of4TZEzXM4F3pwn5sDwj8XiNtUf2OxerqxfckQMPlyGJxQf68Vw9C/ASpSr4LVwN6xGzhBbaCqepOpdQEtrT+HTY6BxQ== X-Gm-Message-State: AOJu0Yy3ppKbBrLAtTxZE9rdP6hhtXqnk2TIQ3uZvXy8MKh9cjjdUTzg dcHt3QSaDCc0Wg6tAp7BHg8YMcUvm9HEyo/Dkg85Ya1KSfxrEZNd X-Received: by 2002:a05:6a20:4327:b0:1a1:8ba0:2845 with SMTP id h39-20020a056a20432700b001a18ba02845mr3047631pzk.29.1710494923132; Fri, 15 Mar 2024 02:28:43 -0700 (PDT) Received: from libra05 ([143.248.188.128]) by smtp.gmail.com with ESMTPSA id nt10-20020a17090b248a00b0029c7236637dsm2490885pjb.5.2024.03.15.02.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 02:28:42 -0700 (PDT) Date: Fri, 15 Mar 2024 18:28:38 +0900 From: Yewon Choi To: Allison Henderson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Cc: "Dae R. Jeong" Subject: [PATCH net v2] rds: introduce acquire/release ordering in acquire/release_in_xmit() Message-ID: 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 acquire/release_in_xmit() work as bit lock in rds_send_xmit(), so they are expected to ensure acquire/release memory ordering semantics. However, test_and_set_bit/clear_bit() don't imply such semantics, on top of this, following smp_mb__after_atomic() does not guarantee release ordering (memory barrier actually should be placed before clear_bit()). Instead, we use clear_bit_unlock/test_and_set_bit_lock() here. Fixes: 0f4b1c7e89e6 ("rds: fix rds_send_xmit() serialization") Fixes: 1f9ecd7eacfd ("RDS: Pass rds_conn_path to rds_send_xmit()") Signed-off-by: Yewon Choi --- Changes in v1 -> v2: - Added missing Fixes tags net/rds/send.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/rds/send.c b/net/rds/send.c index 5e57a1581dc6..8f38009721b7 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -103,13 +103,12 @@ EXPORT_SYMBOL_GPL(rds_send_path_reset); static int acquire_in_xmit(struct rds_conn_path *cp) { - return test_and_set_bit(RDS_IN_XMIT, &cp->cp_flags) == 0; + return test_and_set_bit_lock(RDS_IN_XMIT, &cp->cp_flags) == 0; } static void release_in_xmit(struct rds_conn_path *cp) { - clear_bit(RDS_IN_XMIT, &cp->cp_flags); - smp_mb__after_atomic(); + clear_bit_unlock(RDS_IN_XMIT, &cp->cp_flags); /* * We don't use wait_on_bit()/wake_up_bit() because our waking is in a * hot path and finding waiters is very rare. We don't want to walk -- 2.43.0