Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1239836rdb; Fri, 1 Dec 2023 10:22:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhipuPTVJUF66/2z2b3sCisEVMb31rxqxl36QFd414lKI780hVPM1qmUD4YAqII6hEnveZ X-Received: by 2002:a05:6a00:ad5:b0:6b1:c1c4:ae98 with SMTP id c21-20020a056a000ad500b006b1c1c4ae98mr33017528pfl.18.1701454929044; Fri, 01 Dec 2023 10:22:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701454929; cv=none; d=google.com; s=arc-20160816; b=FX7tmq4ci8oUNRNRummMK66nz6RFvMOXQkP9Of3cDfueGN2Rh3/aZRRSsAGanLv1T/ RLwWYYck4yNuBQwampwfqu5q4V3H4IW3Dm4j81J/hC+O77uH03GJXwSyPbDxG9mVOgZv z4lRkHNRScez/ez/PYyLNh4v5dn4G/DS+DABDNb+AT857BTgmZjJOMt0a+b8FnwkPeup sj8t7ZtseyWBNrq0DJcGzCScreH9IGy8W25fFFCrgFXBeFFdZG5VN/20MwKAh1DubnTo oNMMXtrs3ggN/OJhu95t0xFrG5vkWiQ75mFcfUEgNoHEm1fehC82hsUrYTGtMzFaNudz 5gFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=9Q5iVnz/g8p+rbx5KFaZsp7C8p2LwZkVbCpfuhXo+y0=; fh=m5vUi1ASZXxhbfnQe4fKvDCt26codYwCNe3JYaLxB+w=; b=S1bzFtfpN8/f5IcBP9uSdHko2t+s04V3mTKwgDJoTyAeKsp56fsOlFBKITMsEihk9/ UIBEL/lk03uLcfaoE8lusdFU7FX6RDwpzZPEtNnxc3mDbX+JrChFzNv1apwtVhWs4ALy pyTz2ZxIzaqg13H6PRM8L+9sn0tGccBjIMpn0TNVFrnkVp+xL1IIIHWDV9Ju1cgzVmAf tcrsvxE/+7CFtjYPtU6iEY5Rbm/aK7h5T4rVDhjHg8wtWyz6rX2dII1v2oKhpHQECeK+ Uw3oHgVUS0zpyKQhloLCNGCc5exBH//6qvnxGm+qVXDyhdk8ZWHll8Ls58FCIaUX1Y+q dc+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ssi.bg header.s=ink header.b=iDCiIsLy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ssi.bg Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c8-20020a056a000ac800b00690dbd360basi3705659pfl.152.2023.12.01.10.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 10:22:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=fail header.i=@ssi.bg header.s=ink header.b=iDCiIsLy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ssi.bg Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 604C381C9A55; Fri, 1 Dec 2023 10:22:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379192AbjLASVq (ORCPT + 99 others); Fri, 1 Dec 2023 13:21:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjLASVp (ORCPT ); Fri, 1 Dec 2023 13:21:45 -0500 Received: from mg.ssi.bg (mg.ssi.bg [193.238.174.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 539F0198; Fri, 1 Dec 2023 10:21:50 -0800 (PST) Received: from mg.bb.i.ssi.bg (localhost [127.0.0.1]) by mg.bb.i.ssi.bg (Proxmox) with ESMTP id 2D06B22BA4; Fri, 1 Dec 2023 20:21:47 +0200 (EET) Received: from ink.ssi.bg (ink.ssi.bg [193.238.174.40]) by mg.bb.i.ssi.bg (Proxmox) with ESMTPS id 12C0722B72; Fri, 1 Dec 2023 20:21:47 +0200 (EET) Received: from ja.ssi.bg (unknown [213.16.62.126]) by ink.ssi.bg (Postfix) with ESMTPSA id 046A63C07CA; Fri, 1 Dec 2023 20:21:42 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ssi.bg; s=ink; t=1701454902; bh=RVMVZinltrNpOTYtB7d7CKwLIUe7uVQYlxaaOejZVpc=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=iDCiIsLybtdtJOP92/miL+0hXJQutbzA78zc2zSRJNndjn1As29KrZtNMkJoPj4jb dPmvTLvz3litwT6fNhoyYEQR8qxLY8wSy0brxgaSHjIb/nqvEmXXCz64ppwIjj8Mot j8RuHJzKZflvj/dpCC4v2wfJGVEQ9hYTM7UnJEO0= Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by ja.ssi.bg (8.17.1/8.17.1) with ESMTP id 3B1ILYTx101893; Fri, 1 Dec 2023 20:21:34 +0200 Date: Fri, 1 Dec 2023 20:21:34 +0200 (EET) From: Julian Anastasov To: Doug Anderson cc: Eric Dumazet , Judy Hsiao , David Ahern , Simon Horman , Brian Haley , "David S. Miller" , Jakub Kicinski , Joel Granados , Leon Romanovsky , Luis Chamberlain , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v1] neighbour: Don't let neigh_forced_gc() disable preemption for long In-Reply-To: Message-ID: References: <20231201083926.1817394-1-judyhsiao@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 01 Dec 2023 10:22:05 -0800 (PST) Hello, On Fri, 1 Dec 2023, Doug Anderson wrote: > The place we hit this wasn't actually with fuzzers but with normal > usage in our labs. The only case where it was a really big problem was > when neigh_forced_gc() was scheduled on a "little" CPU (in a > big.LITTLE system) and that little CPU happened to be running at the > lowest CPU frequency. Specifically Judy was testing on sc7180-trogdor > and the lowest CPU Frequency of the "little" CPUs was 300 MHz. Since > the littles are less powerful than the bigs, this is roughly the > equivalent processing power of a big core running at 120 MHz. If we are talking about 32-bit systems with high HZ value I now see a little problem in neigh_alloc() where we may start neigh_forced_gc() later on gc_thresh3, not early on gc_thresh2 as expected. This can happen after a long idle period when last_flush becomes invalid and 'now' is 'time_before' last_flush: - time_after(now, tbl->last_flush + 5 * HZ))) { + !time_in_range_open(now, tbl->last_flush, tbl->last_flush + 5 * HZ))) { With a big gap between gc_thresh2 and gc_thresh3 we may work on large gc_list if we react on gc_thresh3 instead of gc_thresh2. But such storms can not happen more than once per jiffie wrap. > FWIW, we are apparently no longer seeing the bad latency after > , which does this: > > # Increase kernel neighbor table size. > echo 1024 > /proc/sys/net/ipv4/neigh/default/gc_thresh1 > echo 4096 > /proc/sys/net/ipv4/neigh/default/gc_thresh2 We expect to keep the entries not much above 4096 and we should see small gc_list. > echo 8192 > /proc/sys/net/ipv4/neigh/default/gc_thresh3 On invalid last_flush we will free 8192-4096 => 4096 entries under BH lock. Regards -- Julian Anastasov