Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5300992rwe; Tue, 18 Apr 2023 05:12:29 -0700 (PDT) X-Google-Smtp-Source: AKy350anLvAWg6cfNgfnMEsUH9Xb43WW0mAvS9qdCUpy5Sq3FUHXir+k8hoOZcqEGi23higcHq4W X-Received: by 2002:a17:90b:3807:b0:23b:3699:b8a9 with SMTP id mq7-20020a17090b380700b0023b3699b8a9mr1816448pjb.17.1681819949161; Tue, 18 Apr 2023 05:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681819949; cv=none; d=google.com; s=arc-20160816; b=AmJ1O1j1A4RfBqo2JM3bYNJh/gUbfyt/v9PXcRyH02YnU0XowW/hIbbjAivTdWD1r0 WeL0aYUbV+S3MHNcPApKeFqAZkWTsIu1DKp9ACO4sCS8q1IGOROzb+xGy0gUIUIdB7fH Fr6156HPSpxMiAi8loGtGBRLcexpi2SSrQddG0K7tibSb7DN9Z+rD5J4ymkOzFmhXKkO nWx6hq7DsspOiY1limejCD2pOWkVru+AByUNGBHKocKbdcRgERdJbqyWC9RbH+/uYAk6 s7MCbgf50hxW7fSF0B2B4rMAoUQl9fbJYyPlI/D48gFBL2nqReAdHoDXFQ1iuT+ivIFo sztA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ic+G8JxkY030ztDDxrSVr0gIWS+MILOdZNy5BfZjtHQ=; b=HXdz7JV217X7S0s4sV5I6eix+NOUU6EMTzu7BYgewnj4kq3mAy6QWd+jYxmv4QdC+I fCtYz4WsuCrnV3yjBmdH3XMHEyL6cm4pVUPjMYHqe9KRjl/ZFNfaPI+FFVUNIFD/Ctc4 l4bGqHaIgU3SfUyCHZGjVro5c2/e24jlFMXiqNyMEQv7KnG/BplR31emaydXwfCBIVGZ NKNpBx19xMV5S+ciHzfDyTQBd/EPZgpJ50yulyLxlA6q7mE59K5WC/GW+0YwLIpFf9Q5 py9rHpHo/26m/a5Aup5DPlA/9h9Ryb6iqU4X/ZQiwtZZm/yhCMf/Zv2LRVhJ+nr+uy8C WYaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ATx0Ah/I"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a17090ad35000b00247023fdbcbsi15323191pjx.186.2023.04.18.05.12.14; Tue, 18 Apr 2023 05:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ATx0Ah/I"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbjDRMIZ (ORCPT + 99 others); Tue, 18 Apr 2023 08:08:25 -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-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: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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) >