Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1088158pxb; Wed, 1 Sep 2021 17:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk6HOmydAAuunNCSI2Vq+DrMLJeJgnjypdUiWu6AEQxJL1LtnivfxM0AglYfAlsg0vkpBD X-Received: by 2002:a17:906:31ca:: with SMTP id f10mr613287ejf.73.1630541862746; Wed, 01 Sep 2021 17:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630541862; cv=none; d=google.com; s=arc-20160816; b=mihosVcg16WxLNziL43yBPlPrccO4JMnqT11g6Hb5uxeCbym2bEXSxAU6nAcDIgKul 3JMwv55ulTA8GPXbQjL3QcXtRbbhdZIJu/pnFQyyOlQMDoSJ5bMybt2z/RMcASlq16FF tlcd14tRWviUwemy3QRhydXePkPhjO+P5vjaNuf1P/MXZ8SN014W9pzpv7nF5swcNFI5 zzrqLtxL0CkjQvKM3ZgFb0yzNx6tgwoYjd6tpqRWYS7qZad35GQReugoRcg7SMulWuD9 cc44tdtvnlj9nyvknkuqzgIp1HR0suYXT5PRyumlEbH/ure615eg9JsGU6393iLldQBL fABQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xhEOkWP33yhFB7NNvk81879Ir5dlLowUoKbhLb4yxxI=; b=VuADUU5r99/u3fZxZmw39OAiysp7pNaRT1empRcyRnCps52MHknWDDDD1GFrsGxVrB fNWR8aAXGt4qx3W4AZS+L/Xywuk3R/2aTRmNEhRyybH+GC9WpSDdaCKyn2QJt898L2eF HshgP/sjgY8jNiNfShiPJkgNUR9kSrkv0iXpAd7xdvaqVK5qsBFIYT0GxJ0DEDGpCceK jI6HFL5uRH+LuQNnX3LmKJnt/aQ1uluNT3U7cDRjIGZWYuAtfbS30DoWf4FIGRYtcOKA mOH1Ono1Kvym/1h0gsWEfPRDDkWSFhq0/JAbGXcqDKh0LzED4ox4zboDI/eOf38dEd2P +mJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NyyrAAWp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si446667edl.338.2021.09.01.17.17.01; Wed, 01 Sep 2021 17:17:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NyyrAAWp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229898AbhIBAQQ (ORCPT + 99 others); Wed, 1 Sep 2021 20:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243065AbhIBAQQ (ORCPT ); Wed, 1 Sep 2021 20:16:16 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCFA5C061575 for ; Wed, 1 Sep 2021 17:15:18 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id l6so124691edb.7 for ; Wed, 01 Sep 2021 17:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xhEOkWP33yhFB7NNvk81879Ir5dlLowUoKbhLb4yxxI=; b=NyyrAAWpHnMGaaDnOCyuyHd3fhM+X+9xBLDIGnis0cKuJpKW+KT1WR48NcbkpPaCvM 8d0geCI4gkpschCP5E1gkvgXwzCHXeGNIUrUqY5wM+PVnsXFnK4WMQ85S9iGIHksggyb EQPn+5Gu7U+O3tA4GzMQW4BFyG5eBXr4iICM4TmML1jVRIxL0ZkzoCst+4dF21zayx4w Lv/kEXhYY6wRa8B8FlIT8RZ1QdT/zEEIv94jnRkTSLQf82FfHZHLGL2pFzMHDOKzwNra /p6XuljmCisnCopPPSE6I+A89nnv0sBv4B4VaCZLBPH+tSBd/xrckyso1rLdYp73MGsa Vycw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xhEOkWP33yhFB7NNvk81879Ir5dlLowUoKbhLb4yxxI=; b=SbMGRstu27ZoaVSCEAmrcxCGzpG1QHx6ImJN28cSDWBQff/T1GHBg6Xp++sIZeFRIx asB0f/eGwrtVVA+d06s2yx+3uRjaTUnFredljTIyy8yldjz5S0yNpdtfDQpE5Qn3jYz/ ZXMilxKUwZT0yYT5u90IF8i8xajx5xgO5jxCgek95UfyJ9wuBLpN8egDQ6GSxvp8dsxt YBAHil8/xeh3sdSLAFhlfKzCTd82/q+xWxok2EHdA62+W4a5+b6t7Ikmc1hw0kwboH3l YU1cPWVSfv8kgrF0L2++ULn7bk49jS+wYp7SmrVKLxxl2ion3ByyFpArcu+ENS6fBPss uyPg== X-Gm-Message-State: AOAM530qONGD3GjUHyeZ8XlXQB4u1EIzqOy5+IwSKk6U9J30txJORsU3 Td7TYihj6B0dRrzBCXFu5CEAUFOsYsrgIYnx1mc= X-Received: by 2002:a50:c043:: with SMTP id u3mr576707edd.207.1630541717411; Wed, 01 Sep 2021 17:15:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Thu, 2 Sep 2021 12:15:06 +1200 Message-ID: Subject: Re: Is it possible to implement the per-node page cache for programs/libraries? To: Matthew Wilcox Cc: Huang Shijie , Shijie Huang , Linus Torvalds , Al Viro , Andrew Morton , Linux-MM , Barry Song , LKML , Frank Wang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 2, 2021 at 12:00 PM Matthew Wilcox wrote: > > On Wed, Sep 01, 2021 at 02:25:34PM +0000, Huang Shijie wrote: > > On Wed, Sep 01, 2021 at 01:30:45PM +0000, Huang Shijie wrote: > > > On Wed, Sep 01, 2021 at 04:25:01AM +0100, Matthew Wilcox wrote: > > > > 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 > > > > > > I created a glibc patch which can do the text replication within a process. > > The "text replication" means the shared libraries, not program itself. > > Thinking about it some more, if you're ok with it only being shared > libraries, you can do this: > > for i in `seq 0 3`; do \ > cp --reflink=always /lib/x86_64-linux-gnu/libc.so.6 \ > /lib/x86_64-linux-gnu/libc.so.6.numa$i; \ > done > > Reflinked files don't share page cache, so you can do this all in > userspace with no kernel changes. Not quite sure I catch your point. In case we are running mysql on a machine with 128 cores (4numa, 32cores in each numa), how will the reflink help the only mysql process to leverage its local libc copy? Thanks Barry