From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17EC9C77B75 for ; Tue, 18 Apr 2023 12:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231621AbjDRMI0 (ORCPT ); Tue, 18 Apr 2023 08:08:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbjDRMIG (ORCPT ); Tue, 18 Apr 2023 08:08:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E46CC1B for ; Tue, 18 Apr 2023 04:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681819135; 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: in-reply-to:in-reply-to:references:references; bh=ic+G8JxkY030ztDDxrSVr0gIWS+MILOdZNy5BfZjtHQ=; b=ATx0Ah/Icikd2b0ThTNn6hIqlIZ+y0ZX/uNRpW+t3oXPfS6xO1cXOr53O7iL/yVD1KvGH1 S2b0qE+RfwbizcSQUGuS8P4HQmeSUOnLWR/2LRgYb8kICNN2KhGvum26j35GgCbms+szG3 E3j8MuAGl5DeBpo59MJrfmchoDyFucg= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-YUV7Dt8BNdGXz_oOqz59ZA-1; Tue, 18 Apr 2023 07:58:52 -0400 X-MC-Unique: YUV7Dt8BNdGXz_oOqz59ZA-1 Received: by mail-wm1-f70.google.com with SMTP id fl8-20020a05600c0b8800b003f16fe94249so4147009wmb.9 for ; Tue, 18 Apr 2023 04:58:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681819131; x=1684411131; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ic+G8JxkY030ztDDxrSVr0gIWS+MILOdZNy5BfZjtHQ=; b=Qp/TG8s2Xh4uTk2qcwcvOGocfwFHaK+b+hdkDJSpsaThb3zkyJz43mykyzpCmpVeFi 4KeNYCWA/zPAD/yolsAq1QWbMaD1f01sfNkYQxRKkAK+tloP0mVea/657Y6IevypTY6w ugbCxNfGUtyTB9n/sJzle3XqiqgaR0MMJFPx+qWH+00pEw9Fc05asDaXSy7rTYg36c0S QEkHxSlrVhyh0pR4bxJZ7oCOqPS64kMjwOoXdQn2F5RPy0lOe5rQNO47ptNY2PR93+J8 2EJD5F/Giu3ekdrJDikG9r32+l6zX9ylY8/YnTAVBs4ocg6WUEE87C+/wPJSxE8pG0K4 j3nw== X-Gm-Message-State: AAQBX9cS5tFsV15jfoLvQSc6BNbpHWtiKdt7x/S6h2tYRqTyCqm/IbEZ 2qJ3cp6FHfyqLzpn4YqxSqPuOWJRLpd0SSzDpkB+96ZEBli0xilIbh0EwNeqFulkVaX3yOLVh6h 67IlMFq1XInxidkmd/7uuEapW X-Received: by 2002:a7b:cb07:0:b0:3f0:5519:9049 with SMTP id u7-20020a7bcb07000000b003f055199049mr13710172wmj.8.1681819131390; Tue, 18 Apr 2023 04:58:51 -0700 (PDT) X-Google-Smtp-Source: AKy350YYPfT3gB+38KJa3OuGZh4qKj+97YG3AusxGQ1ufp+BlxDKePtvpPOBSG270xYpIPQ/XjAu0Q== X-Received: by 2002:a7b:cb07:0:b0:3f0:5519:9049 with SMTP id u7-20020a7bcb07000000b003f055199049mr13710144wmj.8.1681819131056; Tue, 18 Apr 2023 04:58:51 -0700 (PDT) Received: from localhost ([37.160.130.245]) by smtp.gmail.com with ESMTPSA id m4-20020a05600c4f4400b003f0ae957fcesm12903095wmq.42.2023.04.18.04.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 04:58:50 -0700 (PDT) Date: Tue, 18 Apr 2023 13:58:46 +0200 From: Andrea Claudi To: Abhijeet Rastogi Cc: Julian Anastasov , Simon Horman , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ipvs: change ip_vs_conn_tab_bits range to [8,31] Message-ID: References: <20230412-increase_ipvs_conn_tab_bits-v1-1-60a4f9f4c8f2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 13, 2023 at 06:58:06PM -0700, Abhijeet Rastogi wrote: > Hi Simon, Andrea and Julian, > > I really appreciate you taking the time to respond to my patch. Some follow up > questions that I'll appreciate a response for. > > @Simon Horman > >In any case, I think this patch is an improvement on the current situation. > > +1 to this. I wanted to add that, we're not changing the defaults > here, the default still stays at 2^12. If a kernel user changes the > default, they probably already know what the limitations are, so I > personally don't think it is a big concern. > > @Andrea Claudi > >for the record, RHEL ships with CONFIG_IP_VS_TAB_BITS set to 12 as > default. > > Sorry, I should have been clearer. RHEL ships with the same default, > yes, but it doesn't have the range check, at least, on the version I'm > using right now (3.10.0-1160.62.1.el7.x86_64). > > On this version, I'm able to load with bit size 30, 31 gives me error > regarding allocating memory (64GB host) and anything beyond 31 is > mysteriously switched to a lower number. The following dmesg on my > host confirms that the bitsize 30 worked, which is not possible > without a patch on the current kernel version. > > "[Fri Apr 14 01:14:51 2023] IPVS: Connection hash table configured (size=1073741 > 824, memory=16777216Kbytes)" I see. This makes sense to me as RHEL 7 does not include the range check, while RHEL 8 and RHEL 9 both includes it. The reason why any number beyond 31 results in a lower number is to be searched in gcc implementation. IIRC shifting an int by more than 31 or less than 0 results in an undefined behaviour, according to the C standard. > > @Julian Anastasov, > >This is not a limit of number of connections. I prefer > not to allow value above 24 without adding checks for the > available memory, > > Interesting that you brought up that number 24, that is exactly what > we use in production today. One IPVS node is able to handle spikes of > 10M active connections without issues. This patch idea originated as > my company is migrating from the ancient RHEL version to a somewhat > newer CentOS (5.* kernel) and noticed that we were unable to load the > ip_vs kernel module with anything greater than 20 bits. Another > motivation for kernel upgrade is utilizing maglev to reduce table size > but that's out of context in this discussion. > > My request is, can we increase the range from 20 to something larger? > If 31 seems a bit excessive, maybe, we can settle for something like > [8,30] or even lower. With conn_tab_bits=30, it allocates 16GB at > initialization time, it is not entirely absurd by today's standards. > > I can revise my patch to a lower range as you guys see fit. > > -- > Cheers, > Abhijeet (https://abhi.host) >