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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20B04C433F5 for ; Fri, 22 Apr 2022 17:01:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82DD86B0075; Fri, 22 Apr 2022 13:01:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DD876B007D; Fri, 22 Apr 2022 13:01:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67E516B007E; Fri, 22 Apr 2022 13:01:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 56D0A6B0075 for ; Fri, 22 Apr 2022 13:01:14 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 273EC8090E for ; Fri, 22 Apr 2022 17:01:14 +0000 (UTC) X-FDA: 79385130468.24.7D8862D Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by imf01.hostedemail.com (Postfix) with ESMTP id 41D2C40031 for ; Fri, 22 Apr 2022 17:01:11 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id k29so7764668pgm.12 for ; Fri, 22 Apr 2022 10:01:13 -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=VJV3GlV2KoQdyezliIRHOvJPKg6R4osdv99xx1CZcIo=; b=NeLBxNsLeJVqpPQ4ADuaIMGol/yx7d7W9jTaQMVdmH5q1UJkhTyTwDiDbF8cCsNWG0 GRIaF7CeL0Vx9y0fviCR7SY/1siBLcYSXTcXnXXyYyBHUUD8PwEWdODWLT4O5ia/2uDW 1Wc4j2/kitmoTPZQGMcRkGNbUT3WLzOz1T2G9qOj79NUMJV+v6lKbxlpl9vLcJbtZgG/ vqzNHHDx8nCZgVmTj+K8uZv2F0r1njTtoDa9XQxZU0se8Y2hgGHw3nkSPhnuw8BjdUWM 8kNZGwQonyPvwHut92JJMPM87gGxr44hlitwuJBVnkP5fYUZLeoO8/qHz4EYasVGrg/W 8EMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VJV3GlV2KoQdyezliIRHOvJPKg6R4osdv99xx1CZcIo=; b=RZHuqiDn8VxOak0lBx8b5Rifc5kVAlwjLfIcE+mgN8BdyOlshl1DAcMK9tf0Sh0VCe mYVCcgUUMnBBio+SVuURsLF56+M+yOhXfNe8334nZuWc/HR5CAWjgTFE0AbUmf4MRiuz OJESNUL1IStxEERj9AdajXfwdZK6T3HKk8N+h3iC4osShv2Om9tZ3cEWCa+vshLOUch7 VvFTFHnCox1UmwBHM6DdqwAej2pgtY5QVBmr2625upKwXdZFHOR7mIRQ8mklNOksQwIt lurd02AQlMFpxnjBQNZ1DDGK6HNY0oO3zzr90UVMNmWOrOUvsoRYgX1Yn6biOqFGdvFS nsUA== X-Gm-Message-State: AOAM531OiNJyXWETIfPoqB+MgWWKN+3eYDM077fUKQ7piKnOhywMALEd 5XXqVLk55Hyg0U+NePb/hsLecAG2CIskM0oLIK8= X-Google-Smtp-Source: ABdhPJxLIJdxg9s+JC0etaHLQdHrfriwhAx0qNhcMRd3L9DLsxmSYWfY9eELllY9lmieTQEmEv6J5nRhGZKjz+B2QmU= X-Received: by 2002:a63:90c3:0:b0:3aa:8b88:6dfd with SMTP id a186-20020a6390c3000000b003aa8b886dfdmr4600035pge.75.1650646872417; Fri, 22 Apr 2022 10:01:12 -0700 (PDT) MIME-Version: 1.0 References: <20220407020953.475626-1-shy828301@gmail.com> <6f7210be7353d1c01dc9f872b2692b83f87f5452.camel@intel.com> In-Reply-To: From: Yang Shi Date: Fri, 22 Apr 2022 10:00:59 -0700 Message-ID: Subject: Re: [PATCH] mm: swap: determine swap device by using page nid To: Aaron Lu Cc: "ying.huang@intel.com" , Michal Hocko , Andrew Morton , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NeLBxNsL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of shy828301@gmail.com designates 209.85.215.178 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 41D2C40031 X-Rspam-User: X-Stat-Signature: itik5zd7dpqjdkzt7k8tocnxobras93t X-HE-Tag: 1650646871-945776 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 21, 2022 at 11:24 PM Aaron Lu wrote: > > On Thu, Apr 21, 2022 at 04:34:09PM +0800, ying.huang@intel.com wrote: > > On Thu, 2022-04-21 at 16:17 +0800, Aaron Lu wrote: > > > On Thu, Apr 21, 2022 at 03:49:21PM +0800, ying.huang@intel.com wrote: > > ... ... > > > > > For swap-in latency, we can use pmbench, which can output latency > > > > information. > > > > > > > > > > OK, I'll give pmbench a run, thanks for the suggestion. > > > > Better to construct a senario with more swapin than swapout. For > > example, start a memory eater, then kill it later. > > What about vm-scalability/case-swapin? > https://git.kernel.org/pub/scm/linux/kernel/git/wfg/vm-scalability.git/tree/case-swapin > > I think you are pretty familiar with it but still: > 1) it starts $nr_task processes and each mmaps $size/$nr_task area and > then consumes the memory, after this, it waits for a signal; > 2) start another process to consume $size memory to push the memory in > step 1) to swap device; > 3) kick processes in step 1) to start accessing their memory, thus > trigger swapins. The metric of this testcase is the swapin throughput. > > I plan to restrict the cgroup's limit to $size. > > Considering there is only one NVMe drive attached to node 0, I will run > the test as described before: > 1) bind processes to run on node 0, allocate on node 1 to test the > performance when reclaimer's node id is the same as swap device's. > 2) bind processes to run on node 1, allocate on node 0 to test the > performance when page's node id is the same as swap device's. > > Ying and Yang, > > Let me know what you think about the case used and the way the test is > conducted. Looks fine to me. To measure the latency, you could also try the below bpftrace script: #! /usr/bin/bpftrace kprobe:swap_readpage { @start[tid] = nsecs; } kretprobe:swap_readpage /@start[tid]/ { @us[comm] = hist((nsecs - @start[tid]) / 1000); delete(@start[tid]); }