Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp731467pxj; Wed, 16 Jun 2021 12:14:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhG4s8pstWdgVR+k6qzs3AsHhWsOaP1KTr9MEdO28NkccwW2OEypc2qjBTO1If9RFQ5Vtn X-Received: by 2002:a17:907:3e04:: with SMTP id hp4mr1041169ejc.473.1623870862143; Wed, 16 Jun 2021 12:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623870862; cv=none; d=google.com; s=arc-20160816; b=jRUPXofkko2Ck2YVUfmnlXjl6pTkITXaTrhvqqrJFReZIQCSoBKSQrCef46Nb9K8ov nKBfvycqFZORbPYZx5MQ/8RtQThLeD1Xh8J/ml4txYgIqCjXdJ3UrnVuoVEp0wP9AouK AttpXolMDRwtjjtI1dp/Iyi6aNSW2o8XDJIbRZI9iXsPdziQqnb54kzyUHccrq+VBC3H IgGGvf+scOvHvgXyPfGXnM2IPb0sj3QVNo6+GmtzZyotnfwKlWosG+PAlEbtsuY/elMH bZuJ6PduqWa6orD2nnIO02UHt1xPeaQEQ6x6heUOGSOT9edzpEZoxgTeQUorI6s/tCcK CkLw== 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=ygnL0VWWUCaRKuD4WOXSs1PpwdxT7CIxbiQY+XaRtgg=; b=CCgZo5kDLlP0vR9aczJmw+fCZCNmsFPI5bEx4WfeDQ/3TkSxuPAlHnkdN2GeEs6pRG pyIIK7YR0cVxvgvv04FoYxEsJxP3pZOQnLuv+MJw5ERJwyaCZLdJJur0Eht1bWXBzQtp AMzEW8ah/5v4GjideeAVQNCBDVP3HdTylPI9NWwVQ9K1+L7KHgkMEnmuo/8WSzwkZGkc kfw+cJWRottecpzUKr08mpfXXAOiUEyCPDKO70fKPIls7rzTtm9usrznhoKdZAqjV6Fv SceYa7g80kl2ZSyuFVOs3N3PZ9xcMRusJXv2N96txoATf05zCkZ79HDiFbNL67W59E/N R6gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x4r6f6t9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x20si2698355edr.261.2021.06.16.12.13.59; Wed, 16 Jun 2021 12:14:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x4r6f6t9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234247AbhFPO7C (ORCPT + 99 others); Wed, 16 Jun 2021 10:59:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:41300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233747AbhFPO7B (ORCPT ); Wed, 16 Jun 2021 10:59:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D0EF610CA; Wed, 16 Jun 2021 14:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623855415; bh=PqTEV+Y3Omq+th8DSxU8DPmQr8Af0ZwBW0+urUPYV08=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x4r6f6t9j/vQ6snaJmuTLN6jy4SMMZ+1etChFKUYh5kjup5+uk9/sBKXcHLGuZgQq nyn1QjWZuwt1N/ky+iu2Ptj7G5u8W0JypTLR4XD9Y1VMKn1YdPwp0WT7R96XCVsHTE Z86QIIObBy4H/iPJLU8t/9Z2CQ3488nrzOSsBSg0= Date: Wed, 16 Jun 2021 16:56:53 +0200 From: Greg Kroah-Hartman To: Amit Klein Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Eric Dumazet , Willy Tarreau , "David S. Miller" , Sasha Levin Subject: Re: [PATCH 5.4 175/244] inet: use bigger hash table for IP ID generation Message-ID: References: <20210512144743.039977287@linuxfoundation.org> <20210512144748.600206118@linuxfoundation.org> 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 Wed, Jun 16, 2021 at 12:16:52PM +0300, Amit Klein wrote: > Here is the patch (minus headers, description, etc. - I believe these > can be copied as is from the 5.x patch, but not sure about the > rules...). It can be applied to 4.14.236. If this is OK, I can move on > to 4.9 and 4.4. > > > net/ipv4/route.c | 41 ++++++++++++++++++++++++++++------------- > 1 file changed, 28 insertions(+), 13 deletions(-) > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > index 78d6bc61a1d8..022a2b748da3 100644 > --- a/net/ipv4/route.c > +++ b/net/ipv4/route.c > @@ -70,6 +70,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -485,8 +486,10 @@ static void ipv4_confirm_neigh(const struct > dst_entry *dst, const void *daddr) > __ipv4_confirm_neigh(dev, *(__force u32 *)pkey); > } > > -#define IP_IDENTS_SZ 2048u > - > +/* Hash tables of size 2048..262144 depending on RAM size. > + * Each bucket uses 8 bytes. > + */ > +static u32 ip_idents_mask __read_mostly; > static atomic_t *ip_idents __read_mostly; > static u32 *ip_tstamps __read_mostly; > > @@ -496,12 +499,16 @@ static u32 *ip_tstamps __read_mostly; > */ > u32 ip_idents_reserve(u32 hash, int segs) > { > - u32 *p_tstamp = ip_tstamps + hash % IP_IDENTS_SZ; > - atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ; > - u32 old = ACCESS_ONCE(*p_tstamp); > - u32 now = (u32)jiffies; > + u32 bucket, old, now = (u32)jiffies; > + atomic_t *p_id; > + u32 *p_tstamp; Your patch is corrupted and couldn't be applied if I wanted to :(