Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2310626imm; Tue, 10 Jul 2018 18:00:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeFrRvagaH26VHHwjFzj94eD1OyY9amGefi94MTX8OgHh9e2oszE4Ic2NlqcxtO4QHDXevb X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr26224260plg.68.1531270842220; Tue, 10 Jul 2018 18:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531270842; cv=none; d=google.com; s=arc-20160816; b=cGOFfSWVGs5WC/fHpiBEQZgzFJIjJ6rWx4F9cXzxJRjigZuaUqJ0l7xmUV/9YTKAQ4 a6hUnbn+QjJ3fmzz65ekouerrT5ei8ZO+8qu6ym8+aG3vU4PL9gwU3WoKcdtyXjySL7k g1UzEiG37rlrD9qdu+cXfpVEshoDdrly1yiCXZAQCKCdk+Hs/4juML7zW+igeQS0DJSB v2hCbbAVlDdAauFfHPkMNBZp/1XfFRhNOuU7L3vrbbt1/3z+LALHIfHDCCUMorJMr2oD TWPfT3H2C9Fyl7Bra7wWflS2FA3ym/biH84ElDiWV27ErPFWLc7qQ5VT64mnO23S+J2M W+SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=OxLbiKwnsIx8ickW0EXCW5GGyRvj9dZnc6bIDLIBR1E=; b=ax5QbkVz9l66Uv6rfSRw9BFBHW5cLZuHvMGuf4ccM0yt2wIP1+IW7q+VF5Eisdql1i s5ZoGLsQCUJTfWsTzbAMDfI7GXzb3f77d8IzTJuvv0ysdZA7G0DoGsSe0XRY/dZhGuXx l4aqX+RQ7L4QvwDv80aZAgPWptgcsqsvwyakVgLebK5FDuIygV12bs05B23taQSDBbP1 hyd8WfxW2T+gAv+qXHQh5e/uwLlpv5chlCmReNaqQJf8UWZ9BfT53XvtP3UeNAklcucz IvDf6M3UDoVzlspjwrLjMSdfgkcSEqVC9mqb56LADuQlLxi8PxhaUnZp28IeXaFrV0Gg 07Fg== ARC-Authentication-Results: i=1; mx.google.com; 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 60-v6si18123363ple.65.2018.07.10.18.00.26; Tue, 10 Jul 2018 18:00:42 -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; 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 S1732356AbeGKBBW (ORCPT + 99 others); Tue, 10 Jul 2018 21:01:22 -0400 Received: from mga12.intel.com ([192.55.52.136]:8207 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732263AbeGKBBW (ORCPT ); Tue, 10 Jul 2018 21:01:22 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 17:59:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,336,1526367600"; d="scan'208";a="56696218" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.13.118]) by orsmga006.jf.intel.com with ESMTP; 10 Jul 2018 17:59:40 -0700 From: "Huang\, Ying" To: Dave Hansen Cc: Andrew Morton , , , "Kirill A. Shutemov" , Andrea Arcangeli , Michal Hocko , Johannes Weiner , "Shaohua Li" , Hugh Dickins , Minchan Kim , Rik van Riel , Naoya Horiguchi , Zi Yan , Daniel Jordan Subject: Re: [PATCH -mm -v4 03/21] mm, THP, swap: Support PMD swap mapping in swap_duplicate() References: <20180622035151.6676-1-ying.huang@intel.com> <20180622035151.6676-4-ying.huang@intel.com> <92b86ab6-6f51-97b0-337c-b7e98a30b6cb@linux.intel.com> <878t6jio7x.fsf@yhuang-dev.intel.com> <1b8a9fa8-79a3-c515-26b1-cea6d9eb9aeb@linux.intel.com> Date: Wed, 11 Jul 2018 08:59:40 +0800 In-Reply-To: <1b8a9fa8-79a3-c515-26b1-cea6d9eb9aeb@linux.intel.com> (Dave Hansen's message of "Tue, 10 Jul 2018 06:50:33 -0700") Message-ID: <87pnzuh9j7.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Hansen writes: >> Yes. Boolean parameter isn't good at most times. Matthew Wilcox >> suggested to use >> >> swap_duplicate(&entry, HPAGE_PMD_NR); >> >> vs. >> >> swap_duplicate(&entry, 1); >> >> He thinks this makes the interface more flexible to support other swap >> entry size in the future. What do you think about that? > > That looks great to me too. > >>>> if (likely(!non_swap_entry(entry))) { >>>> - if (swap_duplicate(entry) < 0) >>>> + if (swap_duplicate(&entry, false) < 0) >>>> return entry.val; >>>> >>>> /* make sure dst_mm is on swapoff's mmlist. */ >>> >>> I'll also point out that in a multi-hundred-line patch, adding arguments >>> to a existing function would not be something I'd try to include in the >>> patch. I'd break it out separately unless absolutely necessary. >> >> You mean add another patch, which only adds arguments to the function, >> but not change the body of the function? > > Yes. Or, just add the non-THP-swap version first. OK, will do this. Best Regards, Huang, Ying