Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29006577rwd; Wed, 5 Jul 2023 06:04:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlHhHXrtw+waJrHpcpPNJIdZWsMzax/dSHNXG5RaNrhkoRM1jRlCYsOk60e9vb+C6jVPmxTk X-Received: by 2002:a17:90b:20e:b0:263:730b:f562 with SMTP id fy14-20020a17090b020e00b00263730bf562mr16547114pjb.11.1688562239709; Wed, 05 Jul 2023 06:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688562239; cv=none; d=google.com; s=arc-20160816; b=Cv7reD521vGpB9hq/km5o9MjvW60SQ0N7Qnpl5AG+THmgw6L61UCHEt7VarYHcOt7k V6oR94Voa+BfMmdt0QzQn6Sfo1sENJWxdADUObDLArsrHKa22JB4UT1jyyv3X3Res57k lX37veIPP64F7VeK9Wb5/CH9nvRvlBZVgaWIS+G6GTP+ZiBLMef85sPE7DiC52Fal3Ar FJnAMrICb6eOFPUqA3SwKSYqLwqIkZhKyoKBjRNqUrEnzpTXVH8FcuaQDOJw8maIjLr2 oDpw+ccuEneKhvelH2mIDgLjgZiyh+nOjohD8NwfxOrRlbDj8KR6DnBOWgewoLLxmrYD qBUQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GaAEt0w5sFeWppxb5+woCSrYDyQBk/JRquecuM1eJtQ=; fh=+p4AvWkso0WepfwXViofsVupg5SoaDYAyC6iPQUK6YY=; b=c2N+/iQaip1oFTlnETvFmaQO4D7tKD516+W0PnZJ3DMEo+jfAMTnDHZPe3HrwZGsU4 YfN2rxpnKvtJXpDvgFngJQUkLWUIoh+i4E4OwF+W1+HItUQ8V74g6btkkbvucJJCvByv Lqz19txOAkRK2UQ4QjA1K3L1j5qGnwrTb0e7T25SJjyrZH+zASkvdJsqjQ40ihwQfKXh N82a5QFWhLGXdqXrv99rFYmB21irKQGwWo5COm68PQgomV8MZXIQJ8DdVjxpvSG3dfxq SMa124c5nFWIOmwfC1/CRoM4mDog4hLmnLsDrxXIYt7Hz/S/GyHLYypnVOWIacFNGmeO srnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ji66A5vK; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a17090ac08500b00262fba8f808si1580419pjs.108.2023.07.05.06.03.41; Wed, 05 Jul 2023 06:03:59 -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=@kernel.org header.s=k20201202 header.b=Ji66A5vK; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231868AbjGEMpG (ORCPT + 99 others); Wed, 5 Jul 2023 08:45:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjGEMpF (ORCPT ); Wed, 5 Jul 2023 08:45:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0192E70; Wed, 5 Jul 2023 05:45:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4AC456155A; Wed, 5 Jul 2023 12:45:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F033C433C8; Wed, 5 Jul 2023 12:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688561103; bh=GU1upNTXjEZ+94qjAGPjnfY7h27lWej95MTNM7ZB0o8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ji66A5vKEMs2G6H+4FECRzZb5P8TWN+6djfRgbxtTeC7Eo2Y9hmIyipXdLKfWOGeR /MdNYGel3VZ9XSygP/4N884lDMVgJHah8nQHT5MJCtl4Xk9ohgCD40kQBRt4ip4z3y gSQm84HB3+Ap4T377AA1pgC/2g8AoTFquXluUwJc1GdFkhwbHz53H2fFdnKC9yLM3m nHO0PI64uEEJgJ2lMvUlVAelHnjiq2eE7UfbJqe7UacBRUtHfdKmhVePMlcHB69kO7 ZFsmTkuEH3Y2z+SYtEWi6iroFUMGmKXrVd53WTIUjxUf/RrFboo8T7VKUzEwRBo8Sn frJ8gv/7j1S4A== Date: Wed, 5 Jul 2023 14:45:00 +0200 From: Frederic Weisbecker To: Joel Fernandes Cc: "Paul E . McKenney" , LKML , rcu , Uladzislau Rezki , Neeraj Upadhyay , Giovanni Gherdovich Subject: Re: [PATCH 4/9] rcu: Introduce lazy queue's own qhimark Message-ID: References: <20230531101736.12981-1-frederic@kernel.org> <20230531101736.12981-5-frederic@kernel.org> <20230603012338.GA2795276@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230603012338.GA2795276@google.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Le Sat, Jun 03, 2023 at 01:23:38AM +0000, Joel Fernandes a ?crit : > On Wed, May 31, 2023 at 12:17:31PM +0200, Frederic Weisbecker wrote: > > The lazy and the regular bypass queues share the same thresholds in > > terms of number of callbacks after which a flush to the main list is > > performed: 10 000 callbacks. > > > > However lazy and regular bypass don't have the same purposes and neither > > should their respective thresholds: > > > > * The bypass queue stands for relieving the main queue in case of a > > callback storm. It makes sense to allow a high number of callbacks to > > pile up before flushing to the main queue, especially as the life > > cycle for this queue is very short (1 jiffy). > > Sure. > > > > > * The lazy queue aims to spare wake ups and reduce the number of grace > > periods. There it doesn't make sense to allow a huge number of > > callbacks before flushing so as not to introduce memory pressure, > > especially as the life cycle for this queue is very long (10 > > seconds). > > It does make sense as we have a shrinker, and it is better to avoid RCU > disturbing the system unwantedly when there's lots of memory lying around. > > > > > For those reasons, set the default threshold for the lazy queue to > > 100. > > I am OK with splitting the qhimark, but this lazy default is too low. In > typical workloads on ChromeOS, we see 1000s of callback even when CPU > utilization is low. So considering that, we would be flushing all the time. > > Eventually I want the mm subsystem to tell us when flushing is needed so we > could flush sooner at that time if really needed, but for now we have a > shrinker so it should be OK. Is there a reason the shrinker does not work for > you? So you mean dynamically adapting the lazy qhimark on top of shrinker calls, right? That would make sense indeed. Thanks.