From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCE051990C7 for ; Wed, 15 Jan 2025 16:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736957398; cv=none; b=ORduTXKh/NVoSQnUPfirDxVNGhqIzQej0MNRiNyS7tjcHqxkoUSF0uLfJxintl/3fNzQOvWp+rhuV0uE47ZSJxmbkseA1knzwziVjQR7kAdpxTE86pSyWk3sBNyHq01KHghNni7VXNivxK6kZj5I7agaYqA7ULdnL47zveINNfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736957398; c=relaxed/simple; bh=SnsuHPxSfStugzAu64RdSL0aw74QQ19+hTbgM4CjAZ0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HSa0QiKvLlBFdxdr2AwwyP7rpYhWuEyqUVAXf8jNXf0g/ndE2zqtBQxgp8hppFUW3ilNpRGDxZl1KMtadr145N+SoMGxxJSJ+5mRyDPFbgM0fH9PXFj3y6b3Y2tiRhtTyfNB4lXfdKaJoEIDPnGmdDpFovjZUUiYV0YRkK4APAk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=EcCrA8JO; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="EcCrA8JO" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6dd049b5428so56495496d6.2 for ; Wed, 15 Jan 2025 08:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1736957395; x=1737562195; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=GwXAmYHSg1qu4nbweDde8nvocc74vDmSDCEfZLTyfxQ=; b=EcCrA8JOCo4Y0QPMiZKpYxzCm7EWi+Pfk8fPFQcI/a53lSrRD1NEy49H0wTUlt4yGN QFOo1GT2Z0l4bxpr3j825t9ZNeDLi8CKxCvG8hs5bZUZZK+vn0yTMAfOhesbfaqjXG1O SX0bEKFnPMHH4n60FEHEORedt7tfTVH14yrX18FDqnYtKo5HgOBJJ6yibXcxlYtKfM5L QqY24SMy3iyjxxsDwJRNoypnHiExpNIb6eoeCd5CoLzGs3BPFiOQdGu2T0eqQfnFoSuP CaM0v+ykeVwPR6D92D/IrDqnWRCPwOBuHRtrdo9r7oG+3XVrgn5F8kkK9hz4az8GE8EP c7CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736957395; x=1737562195; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GwXAmYHSg1qu4nbweDde8nvocc74vDmSDCEfZLTyfxQ=; b=CFX+f3IpH/EHjFuHhWgWnwIbzoFRtS6tWRSy6+CgR9ZpcJ5HJTcqmRsPw+Q6sB/F44 o3o5Zrv1X2GE89iM6ScBqqJyPFL4FYnC4PeYuL/PjBf/k4c2jkvueHaiC5L6vIW4XvYE 9uTXXqkZ3RcKFYfrFbTwqk2FOpr286MpDW7iBvIv2xBv4LdXZrY2FH1Q+PCJYIMFN8CN sVZUTKkXRVmIoHFbbDidJjpZ+6/Is1906h8aAI+JRVZKzGRILvA+j/SCp39qKIfnY0Lz cnurLgvMol/DBRV+wQqYBCmXjJ31PfS8XmFYDoQ5nhEFeE97754WqRqCR2JmBBOr3/YH ouNw== X-Forwarded-Encrypted: i=1; AJvYcCU7H5ROuk+nLMHW+poo+cNXXbzq1C3exYL1cRPMwuIS5xXFzB5cl7smc4U71y3aU0dEM1kVK0XU1/pl26A=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0oVjLOkFXpaTU3VFTuTgKckD84W/fqpQsGqmWgGm4x1XEFDxN hgSF1I2pn8qVGlq57gz7qFPImhemFjbYR7zAP5IBzChnOIAPxxAyB5A7itzQBGq2pTaxPKiPAzz 7 X-Gm-Gg: ASbGnctnY0J7GTfRSY1YZcIqGB+iNk4yfDgiwZU5s4JYM7uWQtFCQYN2rGvMFFQD1av 2joCnvF4XphkpgRL/dO99xxpPD1IVTx6sQ5gn25wTW7qX4Ni4sKmP3auG0xxHGBBczfaive+15M W37s+W8Ih8c8IV5jaZHOJocsThTxAg5zZDfisnkpVk5I8YPVm3qAmcDGZaxnoPRK9rPsByXimSL wBDHZ6k5Tk3Z/1UqR8BZLBFjIgXI7iK9drQXxwNM5352pIfx6IxTvWY9k3hvG3AymCaqUaphc1C gu/4zeuoSDa4yivd+UXsbGF0BM1P2ODbz8hAjS0= X-Google-Smtp-Source: AGHT+IG9OqVqrYpVRdGHwnGk+9cS+X1XN6JWtAePm/v/LzF+n+jP+F1Lb8vLGGkBvMZXfzAloxBmeA== X-Received: by 2002:a05:6214:501a:b0:6df:9740:68a3 with SMTP id 6a1803df08f44-6df9b2b3231mr538329106d6.38.1736957395661; Wed, 15 Jan 2025 08:09:55 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46c873cc496sm65947181cf.62.2025.01.15.08.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 08:09:55 -0800 (PST) Date: Wed, 15 Jan 2025 11:09:53 -0500 From: Gregory Price To: Donet Tom Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao , Ritesh Harjani , "Aneesh Kumar K . V" , Matthew Wilcox , David Hildenbrand , Huang Ying , Johannes Weiner Subject: Re: [RFC] mm/swap.c: Enable promotion of unmapped MGLRU page cache pages Message-ID: References: <20250115120625.3785-1-donettom@linux.ibm.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250115120625.3785-1-donettom@linux.ibm.com> On Wed, Jan 15, 2025 at 06:06:25AM -0600, Donet Tom wrote: ... snip ... Thank you for taking the time to do this, I don't have enough background with MGLRU to have done this quickly. I'll pull this onto my branch and carry it if you don't mind so we can keep things tracked. I'll send you an updated RFC before i send out v4 and add appropriate tags. > This difference also impacts read latency: > > For MGLRU, the first read shows higher latency due to the combined > overhead of accessing a lower tier and performing promotion. > > For LRU, the first 3–4 reads typically exhibit lower latency since > promotion does not occur immediately. > Do you have a thought on a good test we can use to compare these strategies? We decided against promotion on first-access because there are many easy-to-imagine scenarios where that will clearly harm performance. We're planning to do some workload testing soon so we can get actual benefit numbers. > +promo_candid: > + if (!folio_test_isolated(folio) && > + (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) && > + numa_pagecache_promotion_enabled) { I am considering putting this in some inline wrapper with some likely() tags to clean this up a bit and optimize the fall-through cases since i've seen some measurable differences when left as-is. Thoughts on this are welcome > + memcg = folio_memcg(folio); > + if (memcg) { Also curious, why only promote when the folio is a member of a memcg? ~Gregory