Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp358559pxb; Wed, 14 Apr 2021 17:45:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1ElrxlS0MfKZryeAoNlONSFDLwNHGEFRPNc6Mna6qmqqEL6EmKg/L17nFtMcOYmdhsNzG X-Received: by 2002:aa7:dc46:: with SMTP id g6mr1017783edu.342.1618447552990; Wed, 14 Apr 2021 17:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447552; cv=none; d=google.com; s=arc-20160816; b=Cpckqp4woHxFqidi991SpPneIS0GqEYcAXeGGm1emmqymSVrDVuIUVk9JQnOarOh2Z KLUcN2YMuO8iqcRDc1E8vAenhGOr9qLARmJFp2dLLwCS4p6MAsDH32geTvenWpRFsiKB qRpEgjR+rk2xTn/BaeGGCPV0UBRYsiADQl894CICyZAIyZCuCDTr4Sw0MPzRMlzSbzyX b+zPSyHGjkhrCYDVC8aOhaK3VIGeXQ1THr0yvlO2ARqPbbqlASnoNPY5FQtBT4SoMMNc GJCcpb6FmZfiix/ywc/N+g5R3YSEQqD9/ZvrzbrgvIKtS6CESl1iQtclaocpK9O6UfkC M5Ew== 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=dCkJ3L6wxS3AzadSsXtpvo5PeGe9Mmz+fl2xNX9Gte0=; b=afi8BvbG32qQSuUDbUw0Jjvrc5bHlJ8ngRGizNj0owYl9RmZmPY7uQbCwfCGgXAWBT DfsfQdTTYrqUxTgeRYV4I4hok/jWMiEa2CmqWozRY4K+SKk+H6l61/j7Lw8nm9fnvpDf /vTBaTQR1SIjRXYZut1KKVezL6zIDDs5Va4//JAJ7DPq4p9uabz4rRp4rFhVUxyn4rc9 JEM0xEwWHro0hPNiXpgLhwSadjGAQPBXXEzPnw5sGI+Rr4tU8TrkBoRLTi8UidUFIUR2 ENiUhtoMXS/HxsuSeW8TaLbDYAp/+m8JUMjFxpZSawkIF+LC3pGrqzubpRYxS3cVh6ff zUQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VRFDLYUY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si798734ejl.750.2021.04.14.17.45.29; Wed, 14 Apr 2021 17:45:52 -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=@google.com header.s=20161025 header.b=VRFDLYUY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232043AbhDNUI4 (ORCPT + 99 others); Wed, 14 Apr 2021 16:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbhDNUIz (ORCPT ); Wed, 14 Apr 2021 16:08:55 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93DA1C061574 for ; Wed, 14 Apr 2021 13:08:33 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id f195-20020a1c1fcc0000b029012eb88126d7so1201147wmf.3 for ; Wed, 14 Apr 2021 13:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dCkJ3L6wxS3AzadSsXtpvo5PeGe9Mmz+fl2xNX9Gte0=; b=VRFDLYUYYllSp7YVuiG8fJNtTM9SQhAmDOG4yLYbySp9D+R+snCUOxK/6p35n59Szz kcmbos1L8lzvhNgy3qiX9OOjlCRl5E8Bbqd5bxq7+GhTrGUEv4PoSMB3kioHkimQob7u /b24BCi6bR+B3SEM2MrtkYHnar2UeMNwEgRy+PZro8xiRzuAjlsdABqUM10ditulXlDa JyQFQlWGeEWimfMKn/uFhkxg8Sq6h9xm9BFaoRvXxyMTod/99Bf7JrEr6RS/XD/zFqsZ O5kWEiS9kLT+a4lJBiquMp/+MjlBn381TGPCAxGtpxKj9KX+Zj3U7hTLjh8Ep89PMlgk +sGA== 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=dCkJ3L6wxS3AzadSsXtpvo5PeGe9Mmz+fl2xNX9Gte0=; b=fyOWVQQJIbUKnRGy2da4yIGnpLWtaHT8oAwAUOgEFTLx7Lc5RXYrA3dfd6SH1Ek91u vj6X5C4rLDpIwgg6QnnmHyRE8umd1m0Nm7PPIeL0zhgCX2b/XG8tVcUCK29mK90fSCPr JMlsy+ABGsAW22zWDwaf7+rkPWfwAhH7BZXAwtfyqwIpjyl0OTAcvQWNgDCIjtPC82N6 5RBPLTAuTxf/iwYUiodNmAs8d6a1lgoKxUSUeY2jMY7jYRzDS+tmC/KcRxN1Ox775Gx+ 0iL4+mMAgBZJHL54gVuIJrxFznQOzXYkR84oUTj2ZonYmT0Z6fehDdS9Js2171vyyOUw 67rA== X-Gm-Message-State: AOAM530iXrabLOoKcvj7o2QIgpPHkyQKXWcAiDwrgUELPXbp71B/Sf0n DVA4Kktcp/03fxyVqOXcU3NAYmF/GKvemDt+rj9FBg== X-Received: by 2002:a7b:cf12:: with SMTP id l18mr4554076wmg.37.1618430912201; Wed, 14 Apr 2021 13:08:32 -0700 (PDT) MIME-Version: 1.0 References: <20210413075155.32652-1-sjpark@amazon.de> <3ddd4f8a-8e51-662b-df11-a63a0e75b2bc@kernel.dk> <20210413231436.GF63242@dread.disaster.area> <20210414155130.GU3762101@tassilo.jf.intel.com> In-Reply-To: From: Yu Zhao Date: Wed, 14 Apr 2021 14:08:20 -0600 Message-ID: Subject: Re: [PATCH v2 00/16] Multigenerational LRU Framework To: Rik van Riel Cc: Andi Kleen , Dave Chinner , Jens Axboe , SeongJae Park , Linux-MM , Andrew Morton , Benjamin Manes , Dave Hansen , Hillf Danton , Johannes Weiner , Jonathan Corbet , Joonsoo Kim , Matthew Wilcox , Mel Gorman , Miaohe Lin , Michael Larabel , Michal Hocko , Michel Lespinasse , Roman Gushchin , Rong Chen , SeongJae Park , Tim Chen , Vlastimil Babka , Yang Shi , Ying Huang , Zi Yan , linux-kernel , lkp@lists.01.org, Kernel Page Reclaim v2 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 14, 2021 at 1:42 PM Rik van Riel wrote: > > On Wed, 2021-04-14 at 13:14 -0600, Yu Zhao wrote: > > On Wed, Apr 14, 2021 at 9:59 AM Rik van Riel > > wrote: > > > On Wed, 2021-04-14 at 08:51 -0700, Andi Kleen wrote: > > > > > 2) It will not scan PTE tables under non-leaf PMD entries > > > > > that > > > > > do not > > > > > have the accessed bit set, when > > > > > CONFIG_HAVE_ARCH_PARENT_PMD_YOUNG=y. > > > > > > > > This assumes that workloads have reasonable locality. Could > > > > there > > > > be a worst case where only one or two pages in each PTE are used, > > > > so this PTE skipping trick doesn't work? > > > > > > Databases with large shared memory segments shared between > > > many processes come to mind as a real-world example of a > > > worst case scenario. > > > > Well, I don't think you two are talking about the same thing. Andi > > was > > focusing on sparsity. Your example seems to be about sharing, i.e., > > ihgh mapcount. Of course both can happen at the same time, as I > > tested > > here: > > https://lore.kernel.org/linux-mm/YHFuL%2FDdtiml4biw@google.com/#t > > > > I'm skeptical that shared memory used by databases is that sparse, > > i.e., one page per PTE table, because the extremely low locality > > would > > heavily penalize their performance. But my knowledge in databases is > > close to zero. So feel free to enlighten me or just ignore what I > > said. > > A database may have a 200GB shared memory segment, > and a worker task that gets spun up to handle a > query might access only 1MB of memory to answer > that query. > > That memory could be from anywhere inside the > shared memory segment. Maybe some of the accesses > are more dense, and others more sparse, who knows? > > A lot of the locality > will depend on how memory > space inside the shared memory segment is reclaimed > and recycled inside the database. Thanks. Yeah, I guess we'll just need to see more benchmarks from the database realm. Stay tuned :)