Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp17970lqc; Thu, 29 Feb 2024 09:08:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUT73yIHq8TzrP/M3qzOHP3eyEZ7Tbp9Eg4q0OSNDLIF8VZiC+zKU/Ui+6oPDkuA4BseF8qxCOYwRd/A7cTFCfqOSOwyfsEPNYQ/2Usow== X-Google-Smtp-Source: AGHT+IEsbaYYTHaikAt64MnBVgqW2xDNYKq59jf+H4+juIIExGOzfPs8rVP5TnBab0t2a8D5oOd7 X-Received: by 2002:a17:906:4f06:b0:a44:4678:532c with SMTP id t6-20020a1709064f0600b00a444678532cmr1500536eju.8.1709226517829; Thu, 29 Feb 2024 09:08:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709226517; cv=pass; d=google.com; s=arc-20160816; b=w0r7eRxz/NmLUE/2ffIfI+5hwvwM0hZmt3x9omB8MMJ75VxYQpcK3V7xlI/nai89eT UHhiFBl5rWW5JKul7Go4/fyBL1dDXM5mMB2syqJm/g4UXzVIj/kry/vuiUN5o4Sov9Iq 9Chj5nI4w31Hc/7FTKycYQ61Kme3F4BjTBM2tLHlEKWD92A+RyWTcVwdpLn42QlcAqxl qlqt4MnfpefvY5G2+0clrttnv1l/CfRFnrSDQHGJBS+UM+H4cLxN34Er2O15Clyy5fgI Ixvq0mRrznRxwUhEBjx/4pc4/AvX5bd1/LJ66Lr3KtdkSsLUDLyXgxZyPuxqxpzp9XCb 9Etg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=amo0eNZtd9oU8O56/+6pIemgnDn7UMyF4LASrdgemWY=; fh=kboScn7Vi3nvNXuaxVsJ5B+4q+F7PC3iR9f6CVP+hKY=; b=03XgJdHpqwP0jYH5I23MOKkbTr0LFe0g9KIpaLQB7ZvkL55jFjL8lx2tyHlRSb63CU wiiSfVV32xB1dpk6eluBGeK+DgZs9uuWwGW6jpMn6RmtnPjGL/0QXd4DeXiArQahhGH6 Emdjufmmfs0cfr7m0EIWczDPkMdIeb+w2ylPElEIFSJq78QZ/5qIH4Pgs5ABZGxrVJWH XX1z/JMZTZ7j9aL42jR5shqqWKmq6+3rlUVtfNkJ/UI7WfH0/Hk/+G6wV4rjNVrmZi8j S5MyFblBt1g5Pn7x/9mShboHPfGbKWgf28l/74ypF077Toy+evCdZTUBGz7VaKjQQH9G 6sbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=oGT4IUcx; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-87145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u24-20020a1709064ad800b00a4455891164si418373ejt.267.2024.02.29.09.08.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 09:08:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=oGT4IUcx; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-87145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 86B091F21D02 for ; Thu, 29 Feb 2024 17:08:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E93235B1EE; Thu, 29 Feb 2024 17:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="oGT4IUcx" Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 60C52383BB for ; Thu, 29 Feb 2024 17:07:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709226473; cv=none; b=XgHy8ERmEaHWR5dmKzsIe7k9qBLu9kEEjjUl4vnGMJsdjFXlrLImN/eYyucNrUfM3OB97xswdtIOxOTYj8sSGW08QelHQoat5KslWccD2eYq8le5hS8tUul128e9VHiLKejs9mPD3kVNFHhRWJZPkd+exFl147HGniwGW/JR7QI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709226473; c=relaxed/simple; bh=amo0eNZtd9oU8O56/+6pIemgnDn7UMyF4LASrdgemWY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jNZZVmkDbJvWnnyuKLbv51rNGnXtBxqKYCqU+qvAO3PWdqKJIg074LYYQITP5dNFXnSJQ6ksUWHyoOgn06KMWPbj3wfrQioniG5K1fsOqQs5eNTOmT7/rf9Pryevx5FuSJM4OX9m41z4GqpgsB7lvWqcyDgtSgljo9hkCsESjO4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=oGT4IUcx; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5654ef0c61fso15576a12.0 for ; Thu, 29 Feb 2024 09:07:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709226470; x=1709831270; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=amo0eNZtd9oU8O56/+6pIemgnDn7UMyF4LASrdgemWY=; b=oGT4IUcxCY0Qbkn5onrXbU2sUUOaNSKb9T76wH1SVAQAIiAwAS5NCLpCsKNmHhoNng kVUsVHdUQ7iZDEj/JKarv/lsnPZdI3+9+99zC843Z2lrkbg/jr6AqzS11xDnGEBEPAPg /5WYJIgI9PDT0IAvalRMaAmv0ulcHjbWblY6XQ7nlvU4tovHBd2Qj3v8WrHMD6Yd03IC sb2UqGeUcW3dZO9kMkYedTygeenLBiWeIXMHgr1ZCvxD0hZusFIVkLm8lqoCMoLijc7E MLQl0xOyfY2pxs1FFEEuKqJdItlSS90PRZMKg9Z7j5Nt4vSotD9sS//qjowqPc+/y25M jzzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709226470; x=1709831270; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=amo0eNZtd9oU8O56/+6pIemgnDn7UMyF4LASrdgemWY=; b=WXdSFDreg2oqJiiH82Er3tPBZliJR1ZNqk0YC9OsHICVWDQfXkAXGMlTVsK7gKSIzn 8LWy4dr6XQccezlurcnC9Yd4PIW59VJFOr9z86F0IVBI8tDGcAb1wEzVQUVv53kuzgln wPAh6kntkyHNqKOC/cjFT47/Prub4mCQJGeu3Fs0DrAzIYSNoGVJ5DIBQNwZ5MvJ9PXX 4G9oAkiiGSURvmy1XgEGzMmf75nJm/+klvGd3assGhFl6fPM5GToyiTIKVewCr6zGD0g Xwkt30yOfV/iq1GK6weL4qfPtm5j2ahvrfWD1idZl0ehZz1EvrjELnSikyAmDnPb43MQ aKdA== X-Forwarded-Encrypted: i=1; AJvYcCWZQGGw/39kuaptdfE9Je2OYYXu+BuLKWVdKcNhXT9huIGv78oA2JJswgU+LyUKEKrL6Pw0o8241NgUKo++OOv09r54nmXPrcNkcdCj X-Gm-Message-State: AOJu0Yzz5Agrq8AdbP6p1rPjl+Tk3zWl4g763v1nyFvGObJbkwf5VK7P HmYu6RG5+UmWU83BvORpauEburFN9GC+hahkGBx7kpwpEQoR6cio5YYjzFI9jQqNmJmxBUrXUN2 woFlhdGJ4Qa4VaimXEG29qFXMrI0ERT/LrZT+ X-Received: by 2002:a05:6402:2227:b0:561:a93:49af with SMTP id cr7-20020a056402222700b005610a9349afmr120493edb.7.1709226469560; Thu, 29 Feb 2024 09:07:49 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240227062833.7404-1-shijie@os.amperecomputing.com> <018b5652-8006-471d-94d0-d230e4aeef6d@amperemail.onmicrosoft.com> In-Reply-To: From: Eric Dumazet Date: Thu, 29 Feb 2024 18:07:36 +0100 Message-ID: Subject: Re: [PATCH v2] net: skbuff: set FLAG_SKB_NO_MERGE for skbuff_fclone_cache To: "Christoph Lameter (Ampere)" Cc: Shijie Huang , Huang Shijie , kuba@kernel.org, patches@amperecomputing.com, davem@davemloft.net, horms@kernel.org, ast@kernel.org, dhowells@redhat.com, linyunsheng@huawei.com, aleksander.lobakin@intel.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, cl@os.amperecomputing.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 29, 2024 at 6:01=E2=80=AFPM Christoph Lameter (Ampere) wrote: > > On Wed, 28 Feb 2024, Shijie Huang wrote: > > >> > >> Using SLAB_NO_MERGE does not help, I am still seeing wrong allocations > >> on a dual socket > >> host with plenty of available memory. > >> (either sk_buff or skb->head being allocated on the other node). > > > > Do you mean you still can see the wrong fclone after using SLAB_NO_MERG= E? > > > > If so, I guess there is bug in the slub. > > Mergin has nothing to do with memory locality. > > >> fclones might be allocated from a cpu running on node A, and freed > >> from a cpu running on node B. > >> Maybe SLUB is not properly handling this case ? > > > > Maybe. > > Basic functionality is broken??? Really? It seems so. > > >> I think we need help from mm/slub experts, instead of trying to 'fix' > >> networking stacks. > > > > @Christopher > > > > Any idea about this? > > > If you want to force a local allocation then use GFP_THISNODE as a flag. > > If you do not specify a node or GFP_THISNODE then the slub allocator will > opportunistically allocate sporadically from other nodes to avoid > fragmentation of slabs. The page allocator also will sporadically go off > node in order to avoid reclaim. The page allocator may go off node > extensively if there is a imbalance of allocation between node. The page > allocator has knobs to tune off node vs reclaim options. Doing more > reclaim will slow things down but give you local data. Maybe, maybe not. Going back to CONFIG_SLAB=3Dy removes all mismatches, without having to use GFP_THISNODE at all, on hosts with plenty of available memory on all nodes. I think that is some kind of evidence that something is broken in SLUB land= .