From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 472BC211276 for ; Thu, 23 Jan 2025 14:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737644165; cv=none; b=pUqo3VGbv5TH2QAZMCZCFSeL+kqh41aK3LI+geKxhRDiLlDudxDkE650prDxmlcmFBvAwAg14CBHJdPh7PzDZlBQwFsQQRu2T6J1reiAcv3GV6pGVa0UOsL0jWW9+uBZ9AHHpOTqRt9seGpDq/aa+r5+39zvPw1LgV+0khSY8pE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737644165; c=relaxed/simple; bh=tY/NItMpCIVVFwzucHwPVn5kv6999ZcDYD9Pf1coTGc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VzjNFY+8UHfsusTCvO3aiSdgrEcoYjpnrKhJrQqZIk7um8k8epB3+/Q3Va8rBZWAZouC9rLwmJBPr1TSNau/HdVn+qpiX1m8j8YWzkf2V6FNugimGs3bQFrlS2zOhIQtgJw2pdxGOjhkwAfenDWH54ThLJ1VhN3o+s93CvLXjMI= 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=H8R46FcA; arc=none smtp.client-ip=209.85.160.176 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="H8R46FcA" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-467a37a2a53so10854971cf.2 for ; Thu, 23 Jan 2025 06:56:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1737644162; x=1738248962; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pIwVMJKPo71eSxVfX67ulub1Z6p//x0W7IgkyVzME2g=; b=H8R46FcAMEC/YLajrDnYXSmgfUpXnXOfUwME3U9wptbD641V+/B7VMNyzU9qYWWXLJ IFUHZA8Xk0kborr25IAHoSrdE0/WG6GNzKSzT5mrjefCwkA7iZSdFEp5x2UH9qLYT0Q8 WHL1TEX/y74bPAXq9+wqs7ZL2PmuQ59aOCCpAa60is7YzLOZKCxY//acJMvt1oLfwtxw A23/s2/XqZ2pBmppkXKQProo1R1i4T2OIdgA1zwv2jkk1Ar9bk5/Acsvux4JoQj36KyZ bVR3hdjT6u/zeWPDwM/TW2994oXvchL0UuSfxodrPt0HOTeni/FSaJwjJzneB7/IM0ix hiPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737644162; x=1738248962; h=in-reply-to: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=pIwVMJKPo71eSxVfX67ulub1Z6p//x0W7IgkyVzME2g=; b=JuyDapMpPiCvcsfVg7H1gfHxR7TJRxg03812cLqJNkw/y4Y3AmQDKDmw1NVkTzkY+6 p0PCTiGMiDTlbI8tGxtOYcES2/BQlLVfPLKlGae4LSs0Sq74CB/lFUpYX+jEdtRIcDm2 ThQEV+NmCuqIpzXsTsaJQdLLXhtB6YSZ4PgXYBwALk3qRXJv3TcXRmdLilUe4wKO9WjT tg7+brm6Ui5h+1IeaNuwuD5JuETx/SrbMiSrJ+djmKzeyeUB8MnrGPXANnHzNwqtO4jn RX5Z/kOlegl0J6NZCExS6PL0bpZ4yPj6nwNPEq7AUUdIsKdoTVXsb2BrBbZyAkBDVxT9 /NaQ== X-Forwarded-Encrypted: i=1; AJvYcCVXzx8CcVqGNXS30f4I3b/grP1Ssg7RKExjqVnLXVBKmKlibE6e+zQF+o1K9g81rmJERcSvshw5NOYSaTY=@vger.kernel.org X-Gm-Message-State: AOJu0YzzA//frePpO5Tro+SQ238yJpghXN48pyQTOI+qL1j+VO9K9ieh 5sLBTrnGwJBn58ycLiXe8uoVeRlpw4nd0p7tG8LGITcuFGvqqGO5Vbjaz8E+/hY= X-Gm-Gg: ASbGnctSTr2SqYLWZTd1GE0BkFNTtvH3KRqrydqQeBw3FwWzbkxIzR9G+Cy+xXMCEcN NyM0haK4VuT0ul+cOiEz1Hn0L1NOFvHiVF55hKbfmuKtfrWbC/jatVpDMmojJELgZPiaa6IMWIF qjJxhz1M6dMFYBhB4PbN2fsyr97qT3bfUuX7LvJ80b3xdN752WS8+UyzZXR1PyHMvwK7SNWK10h U6xSDCMLeEvA0tkDhbgaPQPXQOqbmxL9G52QUg/ouK44t42FHojteQr72YgQQg+AKL23HBPwfbh iq/gNA7r/vXp6K59cs2LvEjNb6bDn5pEAPYBNdRfmOjxjxNyf1+7HQj81UR/nIU= X-Google-Smtp-Source: AGHT+IGurXFrWCspoHbEh5zBy16e7yYpuj/I1/46A8TasxdptOCyhfgUgagF6nJKPP9wQs/0DqSBiA== X-Received: by 2002:a05:6214:240b:b0:6df:97a3:5e76 with SMTP id 6a1803df08f44-6e1b21d13e5mr423495526d6.27.1737644162006; Thu, 23 Jan 2025 06:56:02 -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 6a1803df08f44-6e1ccacdbafsm48001476d6.24.2025.01.23.06.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 06:56:01 -0800 (PST) Date: Thu, 23 Jan 2025 09:55:58 -0500 From: Gregory Price To: "Huang, Ying" Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, nehagholkar@meta.com, abhishekd@meta.com, david@redhat.com, nphamcs@gmail.com, akpm@linux-foundation.org, hannes@cmpxchg.org, kbusch@meta.com, feng.tang@intel.com, donettom@linux.ibm.com Subject: Re: [RFC v3 PATCH 0/5] Promotion of Unmapped Page Cache Folios. Message-ID: References: <20250107000346.1338481-1-gourry@gourry.net> <87v7u7gkuk.fsf@DESKTOP-5N7EMDA> <87y0z2jiom.fsf@DESKTOP-5N7EMDA> 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: <87y0z2jiom.fsf@DESKTOP-5N7EMDA> On Thu, Jan 23, 2025 at 11:46:49AM +0800, Huang, Ying wrote: > Gregory Price writes: > > Test 2 shows overhead of TPP on + pagecache promo off > > Test 3 shows overhead of TPP+Promo on, but all the memory is on top tier > > > > This shows the check as to whether the folio is in the top tier is > > actually somewhat expensive (~5% compared to baseline, ~2.7% compared to > > TPP-on Promo-off). > > This is unexpected. Can we try to optimize it? For example, via using > a nodemask? node_is_toptier() is used in the mapped pages promotion > too (1 vs. 2 above). I guess that the optimization can reduce the > overhead there with measurable difference too. > Agreed it surprised me a bit as well. But more surprising is the fact that test 2 was also 2-3% slower given that it's a simple boolean check against whether tiering is turned on. I suppose that since the test is blowing up the cache/tlb by design, multiple additional cache/tlb misses could cause a non-trivial slowdown, but it is certainly a small puzzle I haven't dug into yet. ~Gregory