Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2282450rbb; Tue, 27 Feb 2024 17:43:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVx4BB6LYbWybhkjcww7SKjcRO/nfx/CraXYunoMD6YdmpRgJSuS5kyJ8pnnhhQY49z4R47ewLASmBmJpxeYZ2UDtS/F0TRxsqvW45Gng== X-Google-Smtp-Source: AGHT+IE6RA4i2sN3xs2IEm2I/X2ssAFDqo/IKJjNJVqFlOVkjbv71PwwZQvLRzwkak0oxL4Pbr0a X-Received: by 2002:a05:6a20:d495:b0:1a0:ce99:9ac6 with SMTP id im21-20020a056a20d49500b001a0ce999ac6mr1454947pzb.26.1709084598113; Tue, 27 Feb 2024 17:43:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709084598; cv=pass; d=google.com; s=arc-20160816; b=D2fC2XCm7SPQb/i4wcwifH8vlZGDx8dXowmUTocCLHjX+8BX/fidoJXl4HRYaUPzV8 nUcbA7aOpxh4yPTzDHBCc8zZk9AkkzFLuym/n+msXqjS7czaSvfu7loLybkRn7Ft0+Hz 45UzNU9iYZM32yMx3R8yC7zYLd9Gm0feCjOGa3Wro1I6m/jIuyWsuSsNKjIULezgqFtW fzO4rpL0tfYrjoEYsMXDOPJg85WpUUinCuzNnT5LRyhCoMndj/AvpIglQeKcDrNK8ptT QIolFpdfUhnhEuuWodOsqfpnxGJkbXhXITGyqYhEnY5BoV0/KfchC0Pn8sPBaBTn0P11 PZKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=EVVmE6TkGRqXVorKr2c+P6OfIn/L2xYewcXn+DF6FE0=; fh=Qfawrb21sGt6MehTT1xPpsHckLnbH/sTMxFDKUr2z/A=; b=Cv/Rk4BDpUqoM6LAzSi3/ikW18SkI50rUG30IJjrNbloc/AtVT0FJdrfhOJTm2XSzP qE3FWuU3k+yb0jzp8eboCRYT78KD9ENwsnZpahvXdiV4LjeUQjW8/g44hOMplgo62AhI lDauGa7bfboOJAPu9lhhe9+ZSOIgTojpWCXRh7HtnQPwinTDY3Wa8IM3dFZU+2TtOzHh IP3mnArimnYM2cWRnQ0Z3pPYYWNpvicQinPgZnQPcdsl4++SCQSfcWT9z3m1PLZShjI6 dYH8XU/4vDYVHNG6CTYRmjxZqWlpqO6vZJQBBBabiD5ODU/Hyhm5EvIDJB025JLH0NFA t5hg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UIgiXhCq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h32-20020a631220000000b005cdc5c70fd5si6184720pgl.531.2024.02.27.17.43.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:43:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UIgiXhCq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6DF4DB25973 for ; Wed, 28 Feb 2024 01:13:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E22291FC4; Wed, 28 Feb 2024 01:13:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UIgiXhCq" 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 0FC65EDD; Wed, 28 Feb 2024 01:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709082799; cv=none; b=WeocnG6kgN5HNQuJSQHPIsTTnMttEcc+P0U18PL48Mva3njNt+lQoDbgjA1ikRDDoQbJmxAro/wIFB/GcI6xD9srpp7b97cOPuUMrGUeUkupVND4vqsSBKYmBauwIPe05cB/uvq59wYGpF2r7gF1LmUX30x+NcgyAofyrAcPynk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709082799; c=relaxed/simple; bh=C+rRmB4z5l9btdhBTc4yMDZ+lILSCJDrkTvKG1X3jXA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=A+CJy20Et4I4TVVmUGFN9hy2er7WnIMbhLcQHCFBKekN6ZfK5iEGlxqK7MGdbGW796hr0Pcb8MqVws0padbt2tQiHF8Z88CYpp5qYDaJfIxguYZ6hZz33oRTOmlwOVYUihqoNuLhDS+37L+c8Gns3Lh0w9M1MMvwFv0xITDgJUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UIgiXhCq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80F75C433F1; Wed, 28 Feb 2024 01:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709082798; bh=C+rRmB4z5l9btdhBTc4yMDZ+lILSCJDrkTvKG1X3jXA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UIgiXhCqo5GJGvw8M0/WD+WE7QrPKzJjzB3pkMf5itTvtlEQ6Lq00qHknYNCbYuhV kAtEO+6SnJqmzJyA/4ieoPAg32PRSbl2G8EW0Ip5c8aok5Scj2duT2A+sao1E2rKMB z0lrm63NvXJtwaL9a2a7wnoMmEBf1qnMV6BfJI8sORNJ+rwf9zKa+044vGv0zlvbON 028bBMDnGdRr2mUuinl1+AkvcxSToOAFso9x7wc5W7E8N6cfrNKtbjLa7AavamtnPz VejFJ91dsPoBoxKlKyDf2flbMJCYGO8MoQeDC07gj/uFMZP4UufQjiDyxvbiNTLvG7 geGMr9qpvCyVQ== Date: Tue, 27 Feb 2024 17:13:16 -0800 From: Jakub Kicinski To: "Lameter, Christopher" Cc: Eric Dumazet , Adam Li , corbet@lwn.net, davem@davemloft.net, pabeni@redhat.com, willemb@google.com, yangtiezhu@loongson.cn, atenart@kernel.org, kuniyu@amazon.com, wuyun.abel@bytedance.com, leitao@debian.org, alexander@mihalicyn.com, dhowells@redhat.com, paulmck@kernel.org, joel.granados@gmail.com, urezki@gmail.com, joel@joelfernandes.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, patches@amperecomputing.com, shijie@os.amperecomputing.com Subject: Re: [PATCH] net: make SK_MEMORY_PCPU_RESERV tunable Message-ID: <20240227171316.40fe9c35@kernel.org> In-Reply-To: References: <20240226022452.20558-1-adamli@os.amperecomputing.com> 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-Transfer-Encoding: 7bit On Tue, 27 Feb 2024 15:08:18 -0800 (PST) Lameter, Christopher wrote: > > This looks good, do you have any performance numbers to share ? > > > > On a host with 384 threads, 384*16 -> 6 GB of memory. > > Those things also come with corresponding memories of a couple of TB... We have a lot of machines at Meta with more cores than gigabytes of memory. Keying on amount of memory would make sense. Something like max(1MB, sk_mem / cores / 8) comes to mind? In fact it may be a better idea to have the sysctl control the divisor (the 8 in my example above). I had issues in the past with people "micro-optimizing" the absolute size, forgetting about it, moving workload to a larger machine and then complaining TCP is choking :(