From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 328EE2DB785 for ; Wed, 1 Apr 2026 11:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043296; cv=none; b=jSwECWbuv6JAm3iIvWFELAGzgtulz2QWwtehG3xRDJL2xLJ1XJRco5/Dn5XTeB2IfXS5YwlddcRsYBIZDC7W+TwZya0aHhnJmePk7oT559+VwAJgQGItDadvv0TrHdzVXoms7B52hw0+0kNJl3xoiMCYnr748rO0a47TbavFtqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043296; c=relaxed/simple; bh=MhODWLU6GRlK9GoERk+tBruRYbXJzDrZM0drld0JhHU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=qdvhjJofzkD4UeMQeoUOmeD4uCm4CM+Y2P6rpTQ41LL/AVSjHf4KCD2F/5LfqGsewssZHl+G+MvsaQfY8kkvsbl6xO0Mi/IEr+tgwgxgufn91T+WfizHpN5bHF+B83/P77Of7t0FU0K8+nVOVG/XPgFOBnwUStY1ELoP3tTMnaI= 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=o8y9zbXB; arc=none smtp.client-ip=95.215.58.176 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="o8y9zbXB" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775043292; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U4YecgBCUmpzx5iM2OYMXpFYsqkJvvJVMsW6paYTTsE=; b=o8y9zbXBNoaEyhU1Becqm4FeWL5e/y/pa1XohYUfFM7yTiy2Jd15j6BNoRJw/HWHZ8WVEO YZbA7EeIk41/v+9bwaRyrBaWxG6NtunV7DlkUrpdewku6xdF9CZI1cZYnZN4egrjmj935x hObjK7f32DlLp6IjGmytU3pFcEtsiKg= From: Lance Yang To: david@kernel.org Cc: lance.yang@linux.dev, kartikey406@gmail.com, usama.arif@linux.dev, Liam.Howlett@oracle.com, ziy@nvidia.com, syzbot+a7067a757858ac8eb085@syzkaller.appspotmail.com, akpm@linux-foundation.org, baohua@kernel.org, baolin.wang@linux.alibaba.com, dev.jain@arm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ljs@kernel.org, npache@redhat.com, ryan.roberts@arm.com, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [mm?] WARNING in deferred_split_folio Date: Wed, 1 Apr 2026 19:34:34 +0800 Message-Id: <20260401113434.29369-1-lance.yang@linux.dev> In-Reply-To: <38a347dc-8a1c-4d04-926d-7a6318e93ca2@kernel.org> References: <38a347dc-8a1c-4d04-926d-7a6318e93ca2@kernel.org> 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=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On Wed, Apr 01, 2026 at 01:22:58PM +0200, David Hildenbrand (Arm) wrote: >On 4/1/26 13:20, Lance Yang wrote: >> >> On Wed, Apr 01, 2026 at 01:00:13PM +0200, David Hildenbrand (Arm) wrote: >>> On 4/1/26 12:53, Lance Yang wrote: >>>> >>>> +Cc Deepanshu >>>> >>>> >>>> Afraid not, it closes the remove_migration_ptes() -> >>>> deferred_split_folio() race, but opens a new one with the shrinker, IIUC >>>> >>>> Once dst is on the deferred split queue, deferred_split_scan() can >>>> pick it up immediately. The shrinker unconditionally dequeues every >>>> folio it visits: >>>> >>>> list_del_init(&folio->_deferred_list); /* always */ >>>> >>>> Then for a non-partially-mapped folio, if folio_trylock() fails >>>> (dst is still locked by migration), it falls through to: >>>> >>>> next: >>>> if (did_split || !folio_test_partially_mapped(folio)) >>>> continue; /* not requeued, dst silently lost */ >>>> >>>> so it is *not* requeued. >>> >>> How is that different to the shrinker just trying to lock the folio before we >>> unlock it and failing? The race already exists? >> >> Ouch, you're right, I was wrong - the trylock drop is a pre-existing >> issue, not caused by the reorder ;) >> >>> >>> To sort out that race a trylock must not result in the folio getting >>> discarded. >> >> Nice, LGTM! >> >> Given that the "trylock -> drop" behavior seems to exist already today, >> do you think it's worth fixing that together with the reorder? > >I'd do it in a single shot if possible. ACK. >Can you craft something? (cc stable etc) certainly, will do! But commit[1] ("mm: migrate: requeue destination folio on deferred split queue") is only in mm-stable now, not yet upstream/stable ... [1] https://lore.kernel.org/mm-commits/20260329004127.334D2C4CEF7@smtp.kernel.org/