Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp411907iog; Thu, 30 Jun 2022 03:16:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1unUUxqYpGxhBbzQrOjEZ4UWcpiO3PXZiFr/cyBpWhcDi7wuqR/3J4DmI+raZgWnDQpx6Ar X-Received: by 2002:a17:907:9805:b0:726:96cf:2bd2 with SMTP id ji5-20020a170907980500b0072696cf2bd2mr8404994ejc.119.1656584198415; Thu, 30 Jun 2022 03:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656584198; cv=none; d=google.com; s=arc-20160816; b=m93gFeJAHUJLL9DjdpvTxzUdx/p2KKH2fXBE5zLomTMnpHOGIAZR1A9imuQ7xyrejH v6j2uF6uSBcnzmyNyuGpJ/zTGW+HHrnpG8NAxf+4bonvWvfGctvodTozEM9HxiUP1jbH iWjvw/SofQ9Q25wWbOz+eY5u8c2dxOCxlZft6YNdBYhj81lQX4xmRx2IRV+V5dAjI0HC e8SMWED1MFNpWfqBA+NXt47IZggupc+VNoFCbFlb0MGj1JZeEvmHx+hG7L9SFZDCWamO Gn4wAobmt7/FfGDlBDyS+SiTpuZgabi1jLEIg1mVaM7nPaAxfD9t5TrWxeWuLON1GGTw M1dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=i9CDmcWsOfvwOw61YSBfcMpe4h93Lq4cMyIbRfjGm9M=; b=FnPOTxCx0VPyjJHH38SwXXme+y2memXZPfWXMJtn95W/AsC3Ji8q4DpLKEoX+yflU9 BD9Mp/0Dddsx1LoaVVtPs3jCOi6mwrJl0Sx9Z8DX42+HG8xBVlNuglCQ9omxTQTGBTLe 2NFFXhgEB3zIsYs0sj5Der3YXXuK2M0dx97SE6Y8DKAmWjmA6s8yvZ7fLGQT7HL4U2NR Unt5G5wwh3S2v+Jy/AoashYXwl84s6tX1op7Gy7Sk10XqAZdS9PFtoHV84TguMSOty+N /E4nqNIj5o+eoTZyUhdcgkpgkG+uA3vPrQcd/sScCW9epfRssmn0gixT8u28CudfJmwA 4h5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Uc+Ucq8U; 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 s2-20020a17090699c200b00718d91da1d9si3093984ejn.950.2022.06.30.03.16.13; Thu, 30 Jun 2022 03:16:38 -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=Uc+Ucq8U; 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 S232125AbiF3J0N (ORCPT + 99 others); Thu, 30 Jun 2022 05:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbiF3J0M (ORCPT ); Thu, 30 Jun 2022 05:26:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D36E33BBEB for ; Thu, 30 Jun 2022 02:26:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6FCB16202C for ; Thu, 30 Jun 2022 09:26:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD5D2C341C8; Thu, 30 Jun 2022 09:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656581170; bh=n6+1Ku6G2yLFJMB63MGn+8LkMx2uRNdQoKXr0T4ZpKE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Uc+Ucq8UCQkRT4WVeKibZ+hzsTWKd6SDZZlIZajvm4rh0bLfgbVLMVhzUtVfAMxNN BfIKDEAWGXTHPEXH6tUY/VXBAYW51V6O1iHceZfF6W8Pk6IsfUe+L3Sc+QW14P9gVH MFHJHBH5fQnlkD5jfqOjts1NH9fwpdywaOpJ553toGYzoGaWqhdJSuxLMitA7Pu4vK lNGyv+LiOM+3JS8SlC5Il0H4qPQJxM5IMgJyr/enJSbxXNxLMSWgorl2SAYzFm0YH+ o54rzbE/eMB/TOA77ntp416nRfrJ1YP57mEe7ZNhrVY1h7pn3zvNlxabcoqGU/EBWr 3dn9GpDTcez+A== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1o6qR6-004IBg-KL; Thu, 30 Jun 2022 10:26:08 +0100 Date: Thu, 30 Jun 2022 10:26:08 +0100 Message-ID: <87o7ya1ozz.wl-maz@kernel.org> From: Marc Zyngier To: Neeraj Upadhyay Cc: , , , , , , , , , , , , , , , Subject: Re: [PATCH v2] srcu: Reduce blocking agressiveness of expedited grace periods further In-Reply-To: <20220630041201.18301-1-quic_neeraju@quicinc.com> References: <20220630041201.18301-1-quic_neeraju@quicinc.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: quic_neeraju@quicinc.com, paulmck@kernel.org, frederic@kernel.org, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org, zhangfei.gao@foxmail.com, boqun.feng@gmail.com, urezki@gmail.com, shameerali.kolothum.thodi@huawei.com, pbonzini@redhat.com, mtosatti@redhat.com, eric.auger@redhat.com, chenxiang66@hisilicon.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.5 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 On Thu, 30 Jun 2022 05:12:01 +0100, Neeraj Upadhyay wrote: >=20 > Commit 640a7d37c3f4 ("srcu: Block less aggressively for expedited > grace periods") highlights a problem where aggressively blocking > SRCU expedited grace periods, as was introduced in commit > 282d8998e997 ("srcu: Prevent expedited GPs and blocking readers > from consuming CPU"), introduces ~2 minutes delay to the overall > ~3.5 minutes boot time, when starting VMs with "-bios QEMU_EFI.fd" > cmdline on qemu, which results in very high rate of memslots > add/remove, which causes > ~6000 synchronize_srcu() calls for > kvm->srcu SRCU instance. >=20 > Below table captures the experiments done by Zhangfei Gao and Shameer > to measure the boottime impact with various values of non-sleeping > per phase counts, with HZ_250 and preemption enabled: >=20 > +=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80+=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80+ > | SRCU_MAX_NODELAY_PHASE | Boot time (s) | > +=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80+=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80+ > | 100 | 30.053 | > | 150 | 25.151 | > | 200 | 20.704 | > | 250 | 15.748 | > | 500 | 11.401 | > | 1000 | 11.443 | > | 10000 | 11.258 | > | 1000000 | 11.154 | > +=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80+=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80+ >=20 > Analysis on the experiment results showed improved boot time > with non blocking delays close to one jiffy duration. This > was also seen when number of per-phase iterations were scaled > to one jiffy. >=20 > So, this change scales per-grace-period phase number of non-sleeping > polls, such that, non-sleeping polls are done for one jiffy. In addition > to this, srcu_get_delay() call in srcu_gp_end(), which is used to calcula= te > the delay used for scheduling callbacks, is replaced with the check for > expedited grace period. This is done, to schedule cbs for completed exped= ited > grace periods immediately, which results in improved boot time seen in > experiments. >=20 > In addition to the changes to default per phase delays, this change > adds 3 new kernel parameters - srcutree.srcu_max_nodelay, > srcutree.srcu_max_nodelay_phase, srcutree.srcu_retry_check_delay. > This allows users to configure the srcu grace period scanning delays, > depending on their system configuration requirements. >=20 > Signed-off-by: Neeraj Upadhyay > Tested-by: Marc Zyngier > --- >=20 > Change in v2: >=20 > - Change srcu_max_nodelay default value to consider phase delay > iterations > - Apply Pauls' feedback > - Add Marc's Tested-by I gave this a go on the same platform as v1, and the result is actually much better as I didn't have to add any extra command-line option to get to a reasonable result (41s). I think we have a winner. Thanks again, M. --=20 Without deviation from the norm, progress is not possible.