Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2341351rwb; Sun, 15 Jan 2023 13:38:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXtq6z0OgnRc1Ul+d1CixYcuySLwlcGngLjAZrw0A8YSZpIXc74aco0UOs7VRhkfCGYkby84 X-Received: by 2002:a05:6a20:d2c7:b0:ad:eaea:e08 with SMTP id ir7-20020a056a20d2c700b000adeaea0e08mr20898901pzb.25.1673818723867; Sun, 15 Jan 2023 13:38:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673818723; cv=none; d=google.com; s=arc-20160816; b=pSTRu96qDCa4qDuSVhpAvU4zv6imT6nIEP6WEQGXZuE1l9B9aEE96oHYu3bHpyW7Iw hXQDgLJeYM/H0wT0S39Lepvu6dXB3kC7QUzL/vs9X0jmIvohJSAUMHVG3D290nun3FxV fMGdbdb454MwA5KpS0qRReypcq4+0VkNhxA0LlZ4iJIGg3f5TvmdEkpdqB3M1M9y2QBP 0HVKIKhGiFMM8vAA5ktuS7LmvtMz59oRYjSPzF4Ca83wLViNu/znL4WJYOFgLRBpLfD8 Nr8t8oFJw2JeMnz3F320LFnyNPHG6Ilm9SLzaBrjNjNHnPkzlFIB6e/Uz7w3fjyImS5m tAWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=imIrwUXXSpGxJHX2IXIa4NzC1jMkxA/rgCDVCw5pEFE=; b=s1q2jY5QkyOq1ooKlS1bE05k/PJWEhGA4aCz2Dl4c0/zhgjOvPbSB+CCqf+MkZkAy7 3vjLgAtfltG4JIKLbhLyOKuBdL52CMF8tyPyYgyiLms4omxhSZ4PGpIeYnLECDEHfRZO /U9y4w8+ReMcizh9WpJZTYCf1RS6OouoAVN942rl0ZnOq5idbaERu0RXEWE9J713qjaN ViPJEW9Tbfg0CjQXg4Jy6/ZRsMP5auv0zUxUMwuJfAUe0+VIOARQm5JWNTJjFaI256J1 YS4IAngjH1vJL4Rm9mpcodEMO+DTQcUeauWOH/hVMMIhANgJbVZ+xaWabL7c3WsQ9+1y 1GBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=RWVPMLhj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j191-20020a638bc8000000b004b69f749766si16452236pge.663.2023.01.15.13.38.36; Sun, 15 Jan 2023 13:38:43 -0800 (PST) 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=@joelfernandes.org header.s=google header.b=RWVPMLhj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231549AbjAOV3x (ORCPT + 54 others); Sun, 15 Jan 2023 16:29:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbjAOV3v (ORCPT ); Sun, 15 Jan 2023 16:29:51 -0500 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1ED1630B for ; Sun, 15 Jan 2023 13:29:50 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id p25so21978303ljn.12 for ; Sun, 15 Jan 2023 13:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=imIrwUXXSpGxJHX2IXIa4NzC1jMkxA/rgCDVCw5pEFE=; b=RWVPMLhj3nzukWBHC/0nsGVSXNfSsDSgW+QuchB/+fHdme4dQ77rAF0NrXjm/cnSO2 +BxKMpMgJY85/EBZEaFUcTlSWeJ8CLONuZIKfYc0s00ztKHQhXEVDA8sMmdOyx/O21v8 Kk6vJ1oidhdWGFl/HL5l5WvkmJvKlPhfletg0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=imIrwUXXSpGxJHX2IXIa4NzC1jMkxA/rgCDVCw5pEFE=; b=JQOyHRu5aasmVZrwkAlJlgzsMN/534Vacq/QKUjAqkbMM6b3oqmtRylKq5CGdLVNdh SiQ29kFLtqa161R4Zh0YldqKTaBbix3N+7t9I2krz+j94CX2vJNjHLK8/Stfm7yttLx4 XvZRxTr4kGtAzmHtVKibwjUCa1stKijzEMkpza1azle9l57uCGXw4iLDPzknXNa5Qds/ YYrvtN9qCRxUryU2dgpyIiv8bZ4ak7RqhTWEbian05SCubqdNSYSF4LuKHR+2BzZxeVC AVa7lwKsQi5Tm4UHK8/mtQqvydvVDsXMVPF3aJ9NRC31tmZBhbn2y+37nxe8WhmyV9Kr 3fsQ== X-Gm-Message-State: AFqh2kqhWvyIE13+wT8RSy7AHUgMoaleMbuQ99Uvseb8Zx6zbeGOUZpx Hh9CvFsGpWBsPkf8ZfKQZ7LciOlzkL+nDgabnjsJFQ== X-Received: by 2002:a2e:964c:0:b0:284:6390:1f8 with SMTP id z12-20020a2e964c000000b00284639001f8mr2589023ljh.167.1673818188816; Sun, 15 Jan 2023 13:29:48 -0800 (PST) MIME-Version: 1.0 References: <20230112005223.2329802-1-joel@joelfernandes.org> <20230112005223.2329802-2-joel@joelfernandes.org> <20230115155455.0fb66c12@rorschach.local.home> In-Reply-To: <20230115155455.0fb66c12@rorschach.local.home> From: Joel Fernandes Date: Sun, 15 Jan 2023 16:29:38 -0500 Message-ID: Subject: Re: [PATCH v2 rcu/dev 2/2] rcu: Disable laziness if lazy-tracking says so To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , "Paul E. McKenney" , rcu@vger.kernel.org, fweisbec@gmail.com, urezki@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Sun, Jan 15, 2023 at 3:55 PM Steven Rostedt wrote: > > On Thu, 12 Jan 2023 00:52:23 +0000 > "Joel Fernandes (Google)" wrote: > > > > > static void > > -__call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy) > > +__call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in) > > { > > static atomic_t doublefrees; > > unsigned long flags; > > struct rcu_data *rdp; > > - bool was_alldone; > > + bool was_alldone, lazy; > > I'm curious to why the the extra variable. > > > > > /* Misaligned rcu_head! */ > > WARN_ON_ONCE((unsigned long)head & (sizeof(void *) - 1)); > > @@ -2622,6 +2622,7 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy) > > kasan_record_aux_stack_noalloc(head); > > local_irq_save(flags); > > rdp = this_cpu_ptr(&rcu_data); > > + lazy = lazy_in && !rcu_async_should_hurry(); > > Wouldn't just having: > > lazy = lazy && !rcu_async_should_hurry(); > > be sufficient? I prefer to not overwrite function arguments, it makes debugging harder IMHO. - Joel > > -- Steve > > > > > /* Add the callback to our list. */ > > if (unlikely(!rcu_segcblist_is_enabled(&rdp->cblist))) { > > --