From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (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 DD5D5453486 for ; Wed, 17 Jun 2026 15:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781709459; cv=none; b=JHxZgdZLEISZ+QGtQUCr0ZB0fQfxtuver+qrDSlG5M1gRnXMyPg9CrlJmPwRgTFbwirH4xF6qYGBpHCJ65XKFblq+A/DLxYCkorArR+1RNM4wtQnFC+ik2eK+bQLktDqwi0Z4dnzKLZIiJTdj0MBHXyF9FTN05f8HueObbRCGOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781709459; c=relaxed/simple; bh=ScU/3jAbBmzRo5wK/OH2VE+d4kR0reTjj656CV8G4ps=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Bw2py77jxitYiMXKVTJQkmdkgGjhKTBQLGdIh3pbh6Vj7dHGuCxtP1wOh8DZALgBl1rYDPilRpOkAGoF95R6UPguCxKknL4TzutmfFz+7STPSVBuri4VVNu5TCTIeDbXqPwAW5/MmPlexPAQrioZPfjSPZ+Xn57nWJhJjLiaZDY= 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=BhVlvqQu; arc=none smtp.client-ip=91.218.175.171 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="BhVlvqQu" Date: Wed, 17 Jun 2026 08:17:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781709453; 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=35F7EX/8BxCUeTVGt42dT6UYLV8vordOiPVBdgmTrGc=; b=BhVlvqQuGtIwg/eIyaTR1yb9BZ4K7Yr7n+aE21IDtC1zCU3e7W7oFIwq2MWnVGklF9r7Ud PirBUoXd2nB/p2MjrCsbQ5aOfTHljqjsnEgdmfOdoINzCNI9O1vtpwI8lF3yBqgpO0mdg5 IMxP0ObgY47zzvphvYoQ7rnc8oecaj8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: "Barry Song (Xiaomi)" Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, chrisl@kernel.org, kasong@tencent.com, shikemeng@huaweicloud.com, nphamcs@gmail.com, baoquan.he@linux.dev, youngjun.park@lge.com, jp.kobryn@linux.dev, usama.arif@linux.dev Subject: Re: [RFC PATCH 1/3] mm: avoid unnecessary lru drain for wp_can_reuse_anon_folio() Message-ID: References: <20260611105124.98668-1-baohua@kernel.org> <20260611105124.98668-2-baohua@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=us-ascii Content-Disposition: inline In-Reply-To: <20260611105124.98668-2-baohua@kernel.org> X-Migadu-Flow: FLOW_OUT On Thu, Jun 11, 2026 at 06:51:22PM +0800, Barry Song (Xiaomi) wrote: > We always unconditionally drain the LRU before retrying anon folio > reuse in wp_can_reuse_anon_folio(). Instead, assume !LRU anon folios > are in lru_cache, and use the refcount to avoid many unnecessary LRU > drains. > > Signed-off-by: Barry Song (Xiaomi) Acked-by: Shakeel Butt