From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4097C432BE for ; Wed, 1 Sep 2021 03:26:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A172F6101B for ; Wed, 1 Sep 2021 03:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241732AbhIAD1C (ORCPT ); Tue, 31 Aug 2021 23:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240843AbhIAD1A (ORCPT ); Tue, 31 Aug 2021 23:27:00 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20800C061575 for ; Tue, 31 Aug 2021 20:26:04 -0700 (PDT) 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=oAgnfSvnfESWGAK8QHbbE4+c2ZjvA7X34fzLdM1J34s=; b=mHfxkE++4EOW/MVei3iNYDbj09 8oY7t0361fX7+XNPRVzdk5pASaQW4i/mGaxnnMTimsb85DO48cwCWrf59R3OkCpfFWEtcDbJh7kWE vbHKS/rKP3XyUMHsQHKy5mxIL19iyqysuK1IX0v25/MhB4I1+YrVZWPzl5XZN3D/WkWL1SsLMkn0r tdvO2KQPmP5pDGjRHyePO4Zc1bqVLkQuaJBURtGa+dNIeBj1Tx1LsPA0+FGex2egdSwVrVD33Aid1 IvSsvRt724M/NQiA8Z0286+VAf/0TzCih4w421nzdp1TsQogM/eccFaRallebMASVMyi27X+u7x/w o3CL2g1g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLGs1-001pbg-I7; Wed, 01 Sep 2021 03:25:06 +0000 Date: Wed, 1 Sep 2021 04:25:01 +0100 From: Matthew Wilcox To: Shijie Huang Cc: torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-mm@kvack.org, song.bao.hua@hisilicon.com, linux-kernel@vger.kernel.org, Frank Wang Subject: Re: Is it possible to implement the per-node page cache for programs/libraries? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01, 2021 at 11:07:41AM +0800, Shijie Huang wrote: > In the NUMA, we only have one page cache for each file. For the > program/shared libraries, the > remote-access delays longer then the local-access. > > So, is it possible to implement the per-node page cache for > programs/libraries? At this point, we have no way to support text replication within a process. So what you're suggesting (if implemented) would work for processes which limit themselves to a single node. That is, if you have a system with CPUs 0-3 on node 0 and CPUs 4-7 on node 1, a process which only works on node 0 or only works on node 1 will get text on the appropriate node. If there's a process which runs on both nodes 0 and 1, there's no support for per-node PGDs. So it will get a mix of pages from nodes 0 and 1, and that doesn't necessarily seem like a big win. I haven't yet dived into how hard it would be to make mm->pgd a per-node allocation. I have been thinking about this a bit; one of our internal performance teams flagged the potential performance win to me a few months ago. I don't have a concrete design for text replication yet; there have been various attempts over the years, but none were particularly compelling. By the way, the degree of performance win varies between different CPUs, but it's measurable on all the systems we've tested on (from three different vendors).