From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 0C3F130F532 for ; Fri, 6 Mar 2026 16:08:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772813304; cv=none; b=So0pbFeFH7l+M4MDI2/F29cblS19Nmmn+4rPpY63KSF+FSkxZYuIyTDdPnaGDvxd+W7ZzRtje7VLAmeiX1DXfX84JbsWpVQgak7cDZMh8ifqYNDdbqXG7ar4uq56fWTNMeZpp9OZnHjXtyE/Y4Tn+kq14sr3OKCSasqbnYLBGsA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772813304; c=relaxed/simple; bh=nc6im44m/ndB/2iSOFsdGSNqUwLQgAVHsTLkAWx15Fg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EPS/A3Hi+dNW4BGwGLDDV7tzSgsM02oDdixuKAEsWbbMM9zrbtzRt20JJLral51EImIDaL/RsRjW0Snm6+zTqhKcYwrLMmoKq8ykSvzrEJ0ozRJNNQCjY5LS4tOGnkm+PHJtfZL/z6izinAy3U4gztb0saW1zNHKJPfb5j3qz/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=v4nZCreM; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="v4nZCreM" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9FEKyNDmEGt3OP13htzSGm2IuEkl/IqkUvpE3rhlHoY=; b=v4nZCreMicroY6XbV83cl2mlbS rLyy4FwfvrZ/WNNf2DqqXCBEIzz19hgJooqBXqAPMInVeeeMN6Xamqb2kuFMQRrqL1UH/8vhQD0zQ ltl0eUgugkV7cBEeRtZLUj+sIQg+KglPaj3vyrfWvP8epnVXHMz5ELuR4g1kDA6gNG+4sjNA5Sxwx 7GEpArVAQKojBI6RiTvBkpW6gE2NTINNTNA+JeRxqTFIEB/PMAhewst2EYMxUrlIlWneMNGPghJ3a nu6EgaCjWXBQ3/7vLTjy5WVh7hTiJAe2XTH8ZMkevtrwxfpJjj6U5cizu9tkluJ3L9RttAx59uHzO 5BL8gwOw==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1vyXid-0000000Gxx9-2zeM; Fri, 06 Mar 2026 16:08:03 +0000 Date: Fri, 6 Mar 2026 16:08:03 +0000 From: Matthew Wilcox To: Usama Arif Cc: "David Hildenbrand (Arm)" , Andrew Morton , npache@redhat.com, ziy@nvidia.com, linux-mm@kvack.org, matthew.brost@intel.com, joshua.hahnjy@gmail.com, hannes@cmpxchg.org, rakie.kim@sk.com, byungchul@sk.com, gourry@gourry.net, ying.huang@linux.alibaba.com, apopple@nvidia.com, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH] mm: migrate: requeue destination folio on deferred split queue Message-ID: References: <20260306133556.2051251-1-usama.arif@linux.dev> <64051a59-680f-40ae-b291-b884aeb7c77b@linux.dev> 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: <64051a59-680f-40ae-b291-b884aeb7c77b@linux.dev> On Fri, Mar 06, 2026 at 05:12:38PM +0300, Usama Arif wrote: > + /* > + * Record whether the source folio is on the deferred split queue > + * before move_to_new_folio(), which unqueues it via > + * __folio_migrate_mapping(). > + */ > + if (folio_test_large(src) && folio_test_large_rmappable(src) && > + !data_race(list_empty(&src->_deferred_list))) Why do you need data_race() here? list_empty() contains a READ_ONCE() so shouldn't be necessary? > + old_page_state |= PAGE_WAS_ON_DEFERRED_SPLIT; You've done a great job of the naming. So much so that the comment seems entirely unnecessary? > + /* > + * Requeue the destination folio on the deferred split queue if > + * the source was on the queue. The source is unqueued in > + * __folio_migrate_mapping(), so we record and check the state > + * from before move_to_new_folio(). > + */ > + if (old_page_state & PAGE_WAS_ON_DEFERRED_SPLIT) > + deferred_split_folio(dst, false); Again, I'm not sure the comment says anything that the code doesn't?