Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1010851imm; Sat, 7 Jul 2018 14:13:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeGsihmA5DLNuBCj7rJQB2H5f4w62lZJoOi4plyb2vqk0MQA+/EA9F979IxehwhGcfEmyen X-Received: by 2002:a63:6a45:: with SMTP id f66-v6mr13404661pgc.81.1530998003791; Sat, 07 Jul 2018 14:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530998003; cv=none; d=google.com; s=arc-20160816; b=yRQyldT1Vb0cyCWbXXtqGf2H5PviteU3VGarc6J0CHYwU3cka0smF9rp9p3LibQ983 b6mmCdliZSNab69aGphbHH+t3u8ag3diFwnKz4dWU6kJo6Qa33n3GFlfSm3HuFPdAY0V DXL1zkytQMRpyDhlJpDMxeHzp+8PFU6SpqKZdZE0Zbmf9T4jFe4FwMTBAz/QosmquB/a 8p4q1ujeasXR4JTf+yBz4RbjeuIz9x+9xuiIYFqOFA/IEOsdz0eVMorjSDlp8SqrjvLJ 6N5bnGc4zv7n0UgXH5O4STZ+9CAdKBtDLjRxyXID95Nk0Yqqg+9JQo09RRQUgS0m79Be 5CxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=UrOpyc5rDKIjDlKF+xN2pAYFHea0QHsKze6etqUfdEw=; b=gx6Nu3yjImSjtwPunjkawE8aHrGKYElF0jXjulyu3Xkzjvzrot4HHW0220Rq07p9o1 PKP9B4GjpCEUkqtJRN70GXPEuEUtW1s36Su0GwQCyQrYXXXC5K+mx9BCp64Pyxukuu9H B9lsatCXPSOFIF09OZAc/QYSJItZJQu26+cQN2KwhTExvmL6T36+Lz/G3q0UW7LdVzCe 903PVrhjnSARcP1Za8RqhEyeSJ+g3lshdoz9G/b6Ka/1SDdjtg2bp8tKTVVjYiyIU6VC 4OtqzyU8d5NojPEst8WRhWpL7/XVg5zTaKSvagSS700rGfH4kJO70n6tViZsyWym8zTa j0TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=voVnQbN2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n34-v6si10725654pgm.28.2018.07.07.14.13.08; Sat, 07 Jul 2018 14:13:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=voVnQbN2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932746AbeGGVLb (ORCPT + 99 others); Sat, 7 Jul 2018 17:11:31 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:36604 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932656AbeGGVLa (ORCPT ); Sat, 7 Jul 2018 17:11:30 -0400 Received: by mail-io0-f193.google.com with SMTP id k3-v6so13835209iog.3 for ; Sat, 07 Jul 2018 14:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UrOpyc5rDKIjDlKF+xN2pAYFHea0QHsKze6etqUfdEw=; b=voVnQbN2aYM39/7N4vh9Wl7y6IOgl+os4AdwAPHhgV5M8rYQrEUT8MacR5dWhkAK2N ry9qwTGi6M8UVI01tqhZn/zPLJ4MpVrFIV6mKQVgCeH0adox4MapNX/JeIXQ7Ev/nIQG FmkHTuflHU5bAxkMDcNJnbNDmD3UmZxtudmW2DZ3cI83ooS0PCRh7LIkhDlCmfuZV2Js zVajBtSA2lv7CZT+mEC4BLu0xHK7yAX9SA8IbuaaLKy8Vz52x16UzYkzY7LDqmMUMHjL 9izI0YlWv1RNT/6pj+G8Zg/Vmc3GV1ev1joGiAekC/kHIRWZWNkdi/LOS1qt3VKlVLY9 oAiw== 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=UrOpyc5rDKIjDlKF+xN2pAYFHea0QHsKze6etqUfdEw=; b=EAq5kZv9miLzJdi4pKUz/UVE0t5of7WQlDoeGmGwCUapaAzDtxc82q9vrXL5Ii9xl2 oJtvwhIdfZCDlXUcFMc9KDRZUacKqpMLbekc55DngSmVOomkhU2Aj8Qbs9F8cZqsNkFy 26kFahteSLxKVu83C2OtnU0SRN9tq8NXb5AlRWgdHhKpm9ssdB+xcVak42nKDIPqDzet LOfaaYm6UyJ2p7aCfBr5gCoozXRsYhfLPKk+TI00Xw5TM3jYCsn/4inhQDBhQDTsOlGe njJDbqlLOx2mXYPM/Idl+GTms0tgLGw8FMdFKGLR5kDKPv3+L/JKcxwwuIKuN2cPQxQW J/Cw== X-Gm-Message-State: AOUpUlFqGvDY/2qoDoi7hsAPW8P7+/OEzZfBTWOy7Dv4YtGuFrkQzvSe sjfPqedWGgEQO5giGqO8cpWy1pcdCSCw/KO9rfg= X-Received: by 2002:a6b:1505:: with SMTP id 5-v6mr4144497iov.56.1530997889506; Sat, 07 Jul 2018 14:11:29 -0700 (PDT) MIME-Version: 1.0 References: <20180622035151.6676-1-ying.huang@intel.com> <20180622035151.6676-2-ying.huang@intel.com> In-Reply-To: <20180622035151.6676-2-ying.huang@intel.com> From: Dan Williams Date: Sat, 7 Jul 2018 14:11:18 -0700 Message-ID: Subject: Re: [PATCH -mm -v4 01/21] mm, THP, swap: Enable PMD swap operations for CONFIG_THP_SWAP To: ying.huang@intel.com Cc: Andrew Morton , linux-mm , Linux Kernel Mailing List , "Kirill A. Shutemov" , Andrea Arcangeli , Michal Hocko , Johannes Weiner , Shaohua Li , hughd@google.com, Minchan Kim , Rik van Riel , Dave Hansen , n-horiguchi@ah.jp.nec.com, zi.yan@cs.rutgers.edu, daniel.m.jordan@oracle.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 21, 2018 at 8:55 PM Huang, Ying wrote: > > From: Huang Ying > > Previously, the PMD swap operations are only enabled for > CONFIG_ARCH_ENABLE_THP_MIGRATION. Because they are only used by the > THP migration support. We will support PMD swap mapping to the huge > swap cluster and swapin the THP as a whole. That will be enabled via > CONFIG_THP_SWAP and needs these PMD swap operations. So enable the > PMD swap operations for CONFIG_THP_SWAP too. > > Signed-off-by: "Huang, Ying" > Cc: "Kirill A. Shutemov" > Cc: Andrea Arcangeli > Cc: Michal Hocko > Cc: Johannes Weiner > Cc: Shaohua Li > Cc: Hugh Dickins > Cc: Minchan Kim > Cc: Rik van Riel > Cc: Dave Hansen > Cc: Naoya Horiguchi > Cc: Zi Yan > Cc: Daniel Jordan > --- > arch/x86/include/asm/pgtable.h | 2 +- > include/asm-generic/pgtable.h | 2 +- > include/linux/swapops.h | 44 ++++++++++++++++++++++-------------------- > 3 files changed, 25 insertions(+), 23 deletions(-) > > diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h > index 99ecde23c3ec..13bf58838daf 100644 > --- a/arch/x86/include/asm/pgtable.h > +++ b/arch/x86/include/asm/pgtable.h > @@ -1224,7 +1224,7 @@ static inline pte_t pte_swp_clear_soft_dirty(pte_t pte) > return pte_clear_flags(pte, _PAGE_SWP_SOFT_DIRTY); > } > > -#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION > +#if defined(CONFIG_ARCH_ENABLE_THP_MIGRATION) || defined(CONFIG_THP_SWAP) How about introducing a new config symbol representing the common infrastructure between the two and have them select that symbol. Would that also allow us to clean up the usage of CONFIG_ARCH_ENABLE_THP_MIGRATION in fs/proc/task_mmu.c? In other words, what's the point of having nice ifdef'd alternatives in header files when ifdefs are still showing up in C files, all of it should be optionally determined by header files.