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 X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E99AFC48BDF for ; Fri, 18 Jun 2021 09:53:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4D81613CB for ; Fri, 18 Jun 2021 09:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232605AbhFRJz5 (ORCPT ); Fri, 18 Jun 2021 05:55:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230399AbhFRJz4 (ORCPT ); Fri, 18 Jun 2021 05:55:56 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D5EC061574; Fri, 18 Jun 2021 02:53:47 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id r7so7768804edv.12; Fri, 18 Jun 2021 02:53:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KphIuuhm2yqQlp9qrgGfS/PVG7WOVx1GZqsoFWVz/zo=; b=fou6MqTcxNm/sRTvOMI5UbAYgRO2oSqp7ClWJ6B8nL5sII3dMrIS/cdcExgi/g0flZ mNrf4HqY8F69jKEAz7pTW6BJdNfpmjneTRpJvN5jBP5xcOu+MlC+h7rDDcF1N6aNSDKc IjHQDCQzl4h7T6/C/b/TNR0jU7mtq4Lb7TP081HUwzeHk8rXh1FO5kch0kW2II0HJaWr 2xSWecdwXbi3LNeoyugiez3x9EHAkWyZTVzBdtPpfzKyDP3pmtmG/cug3d6aVFDOQEgs 2Fu5UWm8fuORY7FwnLR4wFtxR8zj1R4yu6oi27J9L4J6Hph6KUuFFo7OJa2NGuk6xdgv QlgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KphIuuhm2yqQlp9qrgGfS/PVG7WOVx1GZqsoFWVz/zo=; b=rmCf6o/iLmTfbY0OgjW0dUzzSpLBmQN0Kv1CGivwAg/0QpmvfubEJ3lM260oD2DlKN mvCbJHOYFbDBHZWQaZGOWB0/BZ0KOgnb+ltyN7dXeu1YqknXbmmVu6IVvNP8T7bJPmoa W6JfokauVWViufdl2Ueirei/mmzAVBHLAWfzoep2iNPae/QeVMY1ZnRZPWyJrPcjQhMz SHSKFF0zMgFzY5ABm1ZPl3uYgTSDvws+3G8A5gY/V+6mQjbIQGmsG5VG0T5mFS+ax7uq dzU1olZMZkekCoE6FYA1b8QHKB1YphrMBR1X7CzlV+gU7eD3Z91zD1ABUsYRPGy+aqYT fPAw== X-Gm-Message-State: AOAM5320r3Wcmlu4Welwe7aj69jnPCByEf+un39QkqY0scaTiCrmnPOL HmZIT7dkCiN/K4YBoog80uPew8gZM7/tCSuQUkM= X-Google-Smtp-Source: ABdhPJxOrUaBqcE61H02ZwPi8pgyQKHafQ4qIrbTESBbsR8RfA/yufUwS9W/Voq8ONktJM6OoDu+m9Hx3d4ajx7yecI= X-Received: by 2002:a50:d943:: with SMTP id u3mr3884499edj.175.1624010024795; Fri, 18 Jun 2021 02:53:44 -0700 (PDT) MIME-Version: 1.0 References: <20210512144743.039977287@linuxfoundation.org> <20210512144748.600206118@linuxfoundation.org> In-Reply-To: From: Amit Klein Date: Fri, 18 Jun 2021 12:53:33 +0300 Message-ID: Subject: Re: [PATCH 5.4 175/244] inet: use bigger hash table for IP ID generation To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Eric Dumazet , Willy Tarreau , "David S. Miller" , Sasha Levin Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I just submitted a revised patch for 4.14. Sorry for the earlier blunder. On Wed, Jun 16, 2021 at 5:56 PM Greg Kroah-Hartman wrote: > > 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 :( >