From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 2B10B30BF68 for ; Mon, 13 Apr 2026 16:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098662; cv=none; b=BlnGTUH6qxYXHnSH+WE5Dzbrn7uByJKplCyg2nFa61PMThaUy02WhoB7nMyUNNJnS4E4dohoeqQSigWS5C7hSn6dP3s7LZ5AW0Vew7178XNm2wKeMVw5Se0JtaqRHsL5AutS+OhQVaRCL8icOri7qidy2n2VAzMxgxaE6udpTt4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098662; c=relaxed/simple; bh=Xw9cQjk7v9b+/21yZ5WNQQyLvc6VPCIYYVNOd12Snq4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SJsoSEUJ5xDELEXONwfAUvi0aeBLnECV/LZTvZ9pFo3Aj6edzR8x5iXYRdBoYIbVkoTkyOWc7QNgEx6FS41uqfMYtwnGX4mbboHNzqTnjtIzErAG5DoSWJJUq3ulVXBJvylbl9NRvaVWWuLDo13nO15pD40pNB4f5xI2hIYgdNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Ehz/0s4n; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Ehz/0s4n" Date: Mon, 13 Apr 2026 09:44:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1776098659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wGD68R6Uf2ICmpKMNcReMOAnqjM0xbCg+mOS+G4WF7w=; b=Ehz/0s4nbqoB9CGWCN3L7jXsJGgyREW1oQeAdzzWQFJFw0dMRCGLsNZUvGNBNiudpCqSIw mZu/ZZDPolx7I98I1SkSzYq1LeNPLPC4RlBaIOzREx9xxy72ByOHWQ+nmyyxJtlvX2BPcm OK2sR2tA1Es9QNyYOBhkeH2MC3z4wMM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Cao Ruichuang Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, syzbot+1a3353a77896e73a8f53@syzkaller.appspotmail.com Subject: Re: [PATCH] mm/memcontrol: restore irq wrapper for lruvec_stat_mod_folio() Message-ID: References: <20260413064833.964-1-create0818@163.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260413064833.964-1-create0818@163.com> X-Migadu-Flow: FLOW_OUT On Mon, Apr 13, 2026 at 02:48:33PM +0800, Cao Ruichuang wrote: > Commit c1bd09994c4d ("memcg: remove __lruvec_stat_mod_folio") removed > the local_irq_save/restore wrapper around lruvec_stat_mod_folio(), based > on the assumption that the underlying stat update path was already > IRQ-safe. Why is that an assumption? Please explain how lruvec_stat_mod_folio() is not safe against IRQs? > > That assumption is too broad for lruvec_stat_mod_folio() callers. > This helper is not just a thin stat primitive. It also resolves > folio -> memcg -> lruvec under a helper-managed RCU read-side section. > > syzbot now reports a PREEMPT_RT warning from: The syzbot link you have provided has the kernel config without PREEMPT_RT? Where does this claim come from? > > __filemap_add_folio() > -> lruvec_stat_mod_folio() > -> __rcu_read_unlock() > > ending in bad unlock balance / negative RCU nesting. If there is bad unlock balance, how is disabling/enabling IRQs would solve that issue?