From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (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 2835F433D9 for ; Fri, 27 Dec 2024 19:09:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735326597; cv=none; b=M9TI9wVOjncPemd9yipVCA+RX66nEk34dzJc++LphBNCSUAJRtABQQQh4+gSMzUkaarEkCsHrvjqKDEuf07h1dCU/6SKhn58AhNEDE2OAC3xSHMBv9A/4TORRNiJLXG9H3jneTLxeZbuV/5bQJXXYsNLG6EUZeFFnLya8O8tDbY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735326597; c=relaxed/simple; bh=hck1E+w/W0bPHN7E7mRvl8RcNvaDFLpm7nnJfs0wHn8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hgkKPF1NZTTLnR8aK0D4vYoP0Ytm3QwH8ClfgRxjPX7UOMdDpRJKvwaZFurAj4OWXL0CIhu3q9SndPeTaGwKZ4CLAaGNHOF4A2v/4XxGVwEiotqW5awm3LEgaiSSB3z7ppsftMgTFFBgxfiBtqYbzuktfcSHxJBBkGnym6+4Ktc= 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=ERUk0kf9; arc=none smtp.client-ip=209.85.160.172 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="ERUk0kf9" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-46785fbb949so71066741cf.3 for ; Fri, 27 Dec 2024 11:09:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1735326594; x=1735931394; 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=M4ieGUjAhRCRxejnPUhbb7QDcBI4X/XHKrRb/4l1M6M=; b=ERUk0kf9yN+9Z6WiKD4Agzc/igwopdLWipNrRNKZdq1baT0XBBSEXCi3Nw6hgt/Jlw ZEN92yjuwrBrtWXhkv2EXVaQFhBZ4u313cS5EFXvNrbSH06MsHcLFNDEqY++zVQr6hJ0 xNgCEr8JyK4si+HiHamSZF+2+RQHlJ+vT+nPVt/gsR3Le/ZpbNQRZtKEGKW3eN3FUW0x DenYEaulvPEeY57V6IDXEI5ASHLaHHMZKIEuzs5wu2vPvfY4TzCl1BC7OeA8dvIN6vQC Bf9i1vuCR2u4YS1U6HLCGvNbx+/xVRiqykXR5zR7zD8jp6Gckzp1pw5MAUK2avO6rq51 +Edw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735326594; x=1735931394; 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=M4ieGUjAhRCRxejnPUhbb7QDcBI4X/XHKrRb/4l1M6M=; b=p4Jy49dVgs6B9mIFn36UdPa8JmCEmYmy/xKbDSZNAyueKyfjWyIjgOn+bQ3RDgqXn2 gb2psDDVhRARpyf7xsxlNKWI35WUvd4eSx8MB6T7X72seHe6YWRXewhMxPwes0wHObvQ tPvb8kCBdlFiGjL76DbCOhQGzML32bo2L7EbwVEjV5B3mefE+ZfjQVbe73q8yyv0OBXE ClYVfq/X/SZIANn8cm6n49papJYAL0Lzp5bR3eToYz3zXGKZKFCgYDYh7huvwCjCq14U eSFTJN9h3bV2qEJYW25m6n3jSuWpGvCKtjJIttM7niBtusL+Z4iN28erXrCVM674/yla P0sA== X-Forwarded-Encrypted: i=1; AJvYcCUXUsOAmGK4aqf365VBYJIK1q6OsyseP3eF1dcuExrJYaXSxWCBFKTPTHqz/LPd4sOFE4BKjT/W5N6kSuQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwimIZ5yuHqtkYLJ3IriHvLTcx1MRa9JgYmQcVN3wjfiC+hGWpG qaktoWX+C+hbYyQLkvb+EmWclHyFH5jeeIF7xr5gq3RC2yGvzeuS4O7fxvXe0zI= X-Gm-Gg: ASbGncuj8ol/8VYxCWFY9gO99len8udkiL1E5Ky2Tf11+Y3wCeCql2AAqwKx62EM5WD ffI3z/PSK2YQiiGm4srh/74t4NFcncBaKVDCmXwT4ihiqG4RJ+vvxLTQNgl/mXuOq4xqwwLeVWr n4jQGirpRennJZRtKDqajzIKiBgoY6tmg96X+oFyQHPMqW/VVwWF3KU+ry8y8B1RtCJqkd+4kk+ rpIjISZHCBTLqFNGvkV5uGxzA+fj4tf3BGC4gbgSg/XvHW9pF9ch2em6a8xn+zuP8YbXQvMyfPh 2wi4dhtFlT8jqCF4Su7S1Z+D6Ar3u0c2qUiQBFs= X-Google-Smtp-Source: AGHT+IE8QlcUWWMSN9LU13E77ce+nSZx4R5UZM81XHe7pTufIBPxN2YNc4A8DEZWBXylq/6TWNSXkQ== X-Received: by 2002:ac8:5786:0:b0:466:b1d8:96e8 with SMTP id d75a77b69052e-46a4a8eb72emr422957801cf.33.1735326593971; Fri, 27 Dec 2024 11:09:53 -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-46a3eb17e6asm82050841cf.69.2024.12.27.11.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2024 11:09:53 -0800 (PST) Date: Fri, 27 Dec 2024 14:09:50 -0500 From: Gregory Price To: "Huang, Ying" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, nehagholkar@meta.com, abhishekd@meta.com, kernel-team@meta.com, david@redhat.com, nphamcs@gmail.com, akpm@linux-foundation.org, hannes@cmpxchg.org, kbusch@meta.com Subject: Re: [RFC v2 PATCH 0/5] Promotion of Unmapped Page Cache Folios. Message-ID: References: <20241210213744.2968-1-gourry@gourry.net> <87o715r4vn.fsf@DESKTOP-5N7EMDA> <87wmfsi47b.fsf@DESKTOP-5N7EMDA> <87v7v5g99x.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: On Fri, Dec 27, 2024 at 10:40:36AM -0500, Gregory Price wrote: > > Can we measure the largest improvement? For example, run the benchmark > > with all file pages in DRAM and CXL.mem via numa binding, and compare. > > I can probably come up with something, will rework some stuff. > so I did as you suggested, I made a program that allocates a 16GB buffer, initializes it, them membinds itself to node1 before accessing the file to force it into pagecache, then i ran a bunch of tests. Completely unexpected result: ~25% overhead from an inexplicable source. baseline - no membind() ./test Read loop took 0.93 seconds drop caches ./test - w/ membind(1) just before file open Read loop took 1.16 seconds node 1 size: 262144 MB node 1 free: 245756 MB <- file confirmed in cache kill and relaunch without membind to avoid any funny business ./test Read loop took 1.16 seconds enable promotion Read loop took 3.37 seconds <- migration overhead ... snip ... Read loop took 1.17 seconds <- stabilizes here node 1 size: 262144 MB node 1 free: 262144 MB <- pagecache promoted Absolutely bizarre result: there is 0% CXL usage ocurring, but the overhead we originally measured is still present. This overhead persists even if i do the following - disable pagecache promotion - disable numa_balancing - offline CXL memory entirely This is actually pretty wild. I presume this must imply the folio flags are mucked up after migration and we're incurring a bunch of overhead on access for no reason. At the very least it doesn't appear to be an isolated folio issue: nr_isolated_anon 0 nr_isolated_file 0 I'll have to dig into this further, I wonder if this happens with mapped memory as well. ~Gregory