From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.127.231.20 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796359596; b=1IPO9IcPT3crw9e/642zNoDPGpHb1GWLwimyKtVJ+AxkkHPEkN5mOiIlmJSNHvvDp5LS Py3H6uAT+axIl7pbirq6rju1NbOlhlKkrw9jRwcOUkFEUQkQ2+WbTkfq0LGQXo7mXph2R rYOWfHdhlkvLs+/Kyfhcs+/MedH5FAUeGEyCty4Vjkf8yrFJO9Nedwa3RaYtvwQiKGric lENj1I3RicOXrj+ytovPWjx0zbMUVjy5QPE6pUCp22tadkVGJl8NDXPoweSVv/lXt5z2M hUpnBasAfAPAXSu7huSisSucTs9jn2gBA15fKjQwjmhu/UF8NIAzbkjeDvaNGOoc/XQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796359596; h=DMARC-Filter:DKIM-Signature:Message-Id:From:Content-Disposition: X-Lms-Return-Path:Mime-Version:Received:In-Reply-To:Cc:Subject:Date: References:Content-Type:X-Original-From:Content-Transfer-Encoding:To; bh=27nzPceHJL00QVCp059CgSyMJ4yvMS15O2tgMia38H8=; b=DhIYyUL89NIdvmQs1v7vJ8MB/yUdD7k5fFx5Z2CAXtNobHaKcfZqwF+X6nGIAkJ4Wufu DR6YYVxQEBD6GZPjBOS0/2/uNu2pWUBbBDpIcA2xQ2kCl4gHvoMnYhaZwa6zoRJRRDIDm ewU2qx//Zvtb5p2cM62d6lTWhsti0yj/RADPlictstkpy5ACayvTyyk/Q/C78btIna/OF eBXcn2r7CJtiixqTOibQMQAJLLh3dNp/I9oIikDmYikwWO9eKkEly6RRGasBW/I0CLBTS UjIT+mVRAgS/scoOP5odOPFiP7HIZTD2iOOR59Dn+7o43rAwHW0+WhzdJgJzDpvvjVg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=fygo.io; spf=pass smtp.mailfrom=fygo.io; dkim=pass header.d=fygo-io.20200929.dkim.larksuite.com header.i=@fygo-io.20200929.dkim.larksuite.com header.a=rsa-sha256 header.s=s1 header.b=igTTFkGi; arc=none smtp.remote-ip=209.127.231.20 Received: from va-2-20.ptr.blmpb.com (va-2-20.ptr.blmpb.com [209.127.231.20]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96885606A32C for ; Fri, 4 Dec 2026 04:46:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96885606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fygo.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fygo.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=fygo-io.20200929.dkim.larksuite.com header.i=@fygo-io.20200929.dkim.larksuite.com header.a=rsa-sha256 header.s=s1 header.b=igTTFkGi DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=fygo-io.20200929.dkim.larksuite.com; t=1796359589; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=27nzPceHJL00QVCp059CgSyMJ4yvMS15O2tgMia38H8=; b=igTTFkGiVNy/qP1xq+3sDXoeMw5kZTyuNOAcnpIJ1FDGLrG2ZYEvJ4KmyexRtTA1aWoqT9 Da8BhiDi07MZbi+eNYUOsnesAS2kfzFcpgRTICzcl8ReHg1V5zPT6OUtmsdRrYKZHHrXak RBK0d4Pqed2/0TYPsF7HYZt8ChPLYg8hq0JpC5t0U/2K0MAxoj8kUiSvltF2yHndUnbSdY q/nXR24akBGt2V7n70VAqEjhOG2KQxMAOQ5B6BcNg4GwgyBn6ipLpiR6kGgPc0lfNZrZR6 AEyqeoL9R5FKdPEvPCCh4VoGVdvqk3Ovags5x6LvVzt86Y9RbQQCDJSgduZN+A== Message-Id: From: "Coly Li" Content-Disposition: inline X-Lms-Return-Path: X-Mailing-List: linux-bcache@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Received: from studio.local ([120.245.64.92]) by smtp.larksuite.com with ESMTPS; Fri, 04 Dec 2026 04:46:27 +0000 In-Reply-To: <179635128328.74470.8992894868872270442@163.com> Cc: "Kees Cook" , "David Hildenbrand" , "Ingo Molnar" , "Peter Zijlstra" , "Juri Lelli" , "Vincent Guittot" , "Liam R. Howlett" , "Vlastimil Babka" , "Mike Rapoport" , "Michal Hocko" , "Dietmar Eggemann" , "Steven Rostedt" , "Ben Segall" , "Mel Gorman" , "Valentin Schneider" , "K Prateek Nayak" , , , "Kent Overstreet" , Subject: Re: [PATCH] fork: use IS_ENABLED(CONFIG_BCACHE) when initializing sequential_io Date: Fri, 4 Dec 2026 12:46:23 +0800 References: <179635128328.74470.8992894868872270442@163.com> Content-Type: text/plain; charset=UTF-8 X-Original-From: Coly Li Content-Transfer-Encoding: 7bit To: "Pengpeng Hou" On Fri, Dec 04, 2026 at 10:28:03AM +0800, Pengpeng Hou wrote: > When bcache is modular, fork copies the parent's sequential I/O counters > but skips the code that resets them for the child. On a miss in the > recent-I/O table, bcache folds the inherited count into the average > before updating the current count. The average is used to decide whether > to bypass the cache. > > Reset both counters for modular bcache as well as for built-in bcache. > Leave the bypass algorithm unchanged. > > The issue was found by our static-analysis tool and manually reviewed. > > Fixes: cafe56359144 ("bcache: A block layer cache") > Signed-off-by: Pengpeng Hou Acked-by: Coly Li Thanks. Coly Li > --- > The original patch was prepared with Gemini. Codex assisted with this > review and revision (Assisted-by: gpt 5). > Built fork.o on x86-64 with GCC 11.4 and W=1 (CONFIG_BCACHE=m). No > runtime or hardware test was performed. > > kernel/fork.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/fork.c b/kernel/fork.c > index d55a7d21a8fb23b908466b0024aab3f917a6eb7b..cefb6e97b83a4bd9b2f5c94c46e31b5b57d5cebc 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -2285,7 +2285,7 @@ __latent_entropy struct task_struct *copy_process( > p->blocked_on = NULL; /* not blocked yet */ > p->blocked_donor = NULL; /* nobody is boosting p yet */ > > -#ifdef CONFIG_BCACHE > +#if IS_ENABLED(CONFIG_BCACHE) > p->sequential_io = 0; > p->sequential_io_avg = 0; > #endif > > base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106