Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CD62563DC2 for ; Tue, 5 Dec 2023 16:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lWB9cmCu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D25AEC433C8; Tue, 5 Dec 2023 16:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701792486; bh=yv0oFxHwV+zApnuABh1vjm4SdTM4UlVxB9QLNStdBtM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lWB9cmCunmEOwdojFPDFdVQRCePUq0w4CIvREKTs/UxizDcp6eOe7xG53EMI2CDGJ 8mzqRcoCi0ml06/ZgOzCerEja1bQMBSKioUHqDW/j/XgPQX1quiRwB6Kvx2nWS6tLd juIg36W4XFFPkT5kSB4d1r3ML7xxyhqKm7VotPh6pCT8NTY2P06Y0bUgIuGAjB+Vwu onue5IJnQYYNguEWWEGiy+//MlmsXtwqnVpqHI8vKx10Jpz0fmWugRfNm7bRBYiU38 fz6p/S0tgPTY5xnVU/DVlsFQWH3t0HJbNxQXNp6FtThH+EZD7LAqCjBSwBcuZc37uk 54Pd0PBcyKK6w== Message-ID: <73b28f6e-e6de-41a8-8622-3d58832e1582@kernel.org> Date: Tue, 5 Dec 2023 09:08:05 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 net-next 2/2] tcp: reorganize tcp_sock fast path variables Content-Language: en-US To: Coco Li , Jakub Kicinski , Eric Dumazet , Neal Cardwell , Mubashir Adnan Qureshi , Paolo Abeni , Andrew Lunn , Jonathan Corbet , Daniel Borkmann Cc: netdev@vger.kernel.org, Chao Wu , Wei Wang , Pradeep Nemavat References: <20231204201232.520025-1-lixiaoyan@google.com> <20231204201232.520025-3-lixiaoyan@google.com> From: David Ahern In-Reply-To: <20231204201232.520025-3-lixiaoyan@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/4/23 1:12 PM, Coco Li wrote: > The variables are organized according in the following way: > > - TX read-mostly hotpath cache lines > - TXRX read-mostly hotpath cache lines > - RX read-mostly hotpath cache lines > - TX read-write hotpath cache line > - TXRX read-write hotpath cache line > - RX read-write hotpath cache line > > Fastpath cachelines end after rcvq_space. > > Cache line boundaries are enforced only between read-mostly and > read-write. That is, if read-mostly tx cachelines bleed into > read-mostly txrx cachelines, we do not care. We care about the > boundaries between read and write cachelines because we want > to prevent false sharing. > > Fast path variables span cache lines before change: 12 > Fast path variables span cache lines after change: 8 > > Suggested-by: Eric Dumazet > Reviewed-by: Wei Wang > Signed-off-by: Coco Li > --- > include/linux/tcp.h | 248 ++++++++++++++++++++++++-------------------- > net/ipv4/tcp.c | 93 +++++++++++++++++ > 2 files changed, 227 insertions(+), 114 deletions(-) > Reviewed-by: David Ahern