From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 823332E613A for ; Mon, 29 Dec 2025 22:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767045927; cv=none; b=QfWtXkRpWuLZ0cM6QDH5THn71QQo24bOuL8vUFw08NRHosRRem2IU+7ipgOps7F9WJwdrZyyUsUuVzcvUuW3BwrGZKcZSD6KeVfSm7FlY20DB6cg0A5TCA5EnLxl+Ep9G2zM2G0RH4SqB00vvge/Si64cr+qvQYjJhtQhDjmtJs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767045927; c=relaxed/simple; bh=R8cN7MOyCf3orurSkH6qcxpeqE0vE/nNrkX/yIhHdlw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dOF9Vt+rBGmSV1bkqY7Hc3k/jzAIFqS/dd9F4nre6T8koNbVFZ2zMA3h7dBkOFOa+rYvwaJ2f3zoISFHlJ5J3/W6TpOCf8cYoXdJPU9sirgwjUtOgChR0dzmqj5s5VA5edpsQBk3uVLtMh3Y8LB9JOiHcWLbBBkfey4Y0ciXTeY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=CZMHxYct; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="CZMHxYct" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=Content-Type:MIME-Version:Message-ID:Subject:From:Date:From :Subject; bh=LgEdJusk6VEXYo6W2VsxpsxaFwow7QKVuSPndE/g97E=; b=CZMHxYct+qaEmAxJ WTMGarPtPQjTPRWkcHtKjnXPiqwWamCTu73yH81O0me28DbNjCrdaTRJNsnDRa8SNKTVO17CVnOPq 0WCYsYzHcJ2eDUFzUQolAU7VnsTXJPpHlv+99VG2Ix3SOV3xTYJJvKetnfGFpccLHTdm7da0UE/mH JuMrRdFTL5JbWgDa2nvrIo2AL8JQMiiN06S3v2xEG7APNrNYw/MgOBPlHtMHOGABxWbgYEHaBFcHY qkj/DYK2cmG2d1EDSLXObbHaEx9/bQvHnKRkSpl3HtnEJ10Iuyt9LKE5JfQ/FmZcv6A9JLOJahH3r ixJ/axKiiMOnb0ypTQ==; Received: from dg by mx.treblig.org with local (Exim 4.98.2) (envelope-from ) id 1vaLMZ-0000000BeSb-2S2r; Mon, 29 Dec 2025 22:05:15 +0000 Date: Mon, 29 Dec 2025 22:05:15 +0000 From: "Dr. David Alan Gilbert" To: Steven Rostedt Cc: "Paul E. McKenney" , Julia Lawall , Theodore Tso , Sasha Levin , Gabriele Paoloni , Kate Stewart , Chuck Wolber , Dmitry Vyukov , Mark Rutland , Thomas Gleixner , Lorenzo Stoakes , Shuah Khan , Chris Mason , linux-kernel@vger.kernel.org Subject: Re: Follow-up on Linux-kernel code accessibility Message-ID: References: <8005c35a-d8dc-4908-93e5-46bd206f0139@paulmck-laptop> <435c7085-34e-16e9-5711-e53aa54cf4fc@inria.fr> <20251229104005.18b25def@gandalf.local.home> <7f10c583-4d95-432e-a536-898c79b1766d@paulmck-laptop> <20251229153517.0001e755@gandalf.local.home> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20251229153517.0001e755@gandalf.local.home> X-Chocolate: 70 percent or better cocoa solids preferably X-Operating-System: Linux/6.12.48+deb13-amd64 (x86_64) X-Uptime: 21:50:36 up 63 days, 21:26, 2 users, load average: 0.00, 0.00, 0.00 User-Agent: Mutt/2.2.13 (2024-03-09) * Steven Rostedt (rostedt@goodmis.org) wrote: > There's nothing there that says "3" is needed. Why divide at all? Why not > just add 1? Now while Paul obviously doesn't want to tell us, I decided I should do what someone who actually cared would do, and looked at the git history, To my surprise, I see I made a mistake - the three magic constants in this function were all added separately, and the two uses of '3' are not necessarily the same. 8c7c4829a8 - from 2016 rcu: Awaken grace-period kthread if too long since FQS says it's a crude hack but doesn't mention why it chose 3 in the commit message; among other stuff it adds: + WRITE_ONCE(rsp->jiffies_kick_kthreads, + jiffies + 3 * j); 9cf422a8 - from 2018 rcu: Accommodate zero jiffies_till_first_fqs and kthread kicking replaces that: - jiffies + 3 * j); + jiffies + (j ? 3 * j : 2)); to stop using too much cpu and says 'at least two jiffies' fb77dcc - from 2022 rcu: Decrease FQS scan wait time in case of callback overloading introduces the: j = (j + 2) / 3; and commit message says: This commit therefore divides the normal time between rescans by three, rounding up. Thus a small system running at HZ=1000 that is suffering from callback overload will wait only one jiffy instead of the normal three between rescans. So that one does have a commit message explanation at least; although I'm not sure I know where the 'normal three' comes from - but I guess that's followable eventually. But heck, this is making it hard to find them. Dave -- -----Open up your eyes, open up your mind, open up your code ------- / Dr. David Alan Gilbert | Running GNU/Linux | Happy \ \ dave @ treblig.org | | In Hex / \ _________________________|_____ http://www.treblig.org |_______/