From patchwork Fri May 28 14:07:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Tang X-Patchwork-Id: 12287103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0D26C2B9F7 for ; Fri, 28 May 2021 14:07:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 253E2613DD for ; Fri, 28 May 2021 14:07:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 253E2613DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3A8386B0036; Fri, 28 May 2021 10:07:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3305C6B006E; Fri, 28 May 2021 10:07:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AB9E6B0070; Fri, 28 May 2021 10:07:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id D7D416B0036 for ; Fri, 28 May 2021 10:07:13 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6A4673622 for ; Fri, 28 May 2021 14:07:13 +0000 (UTC) X-FDA: 78190816746.23.E8B7D48 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf21.hostedemail.com (Postfix) with ESMTP id 5C7EAE0004EE for ; Fri, 28 May 2021 14:07:01 +0000 (UTC) IronPort-SDR: V7a+fYokBImF/zSsoMmyZ6fEhqpvQa1xr4C9+cNfzE4qDDc9MKNRbaMux/N6c/2ZD5xioKTd2L +iBf6m/6bkaQ== X-IronPort-AV: E=McAfee;i="6200,9189,9998"; a="201075419" X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="201075419" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2021 07:07:08 -0700 IronPort-SDR: c9J/f0NDmZkintRVHYY5bIkCibKTYZYFkS1eLa9jExvqFlvB4BhlxuuV/vSn1GTt6X0C6GUEqP j/nZyT+YERRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,229,1616482800"; d="scan'208";a="481059632" Received: from shbuild999.sh.intel.com ([10.239.147.94]) by fmsmga002.fm.intel.com with ESMTP; 28 May 2021 07:07:04 -0700 From: Feng Tang To: linux-mm@kvack.org, Andrew Morton , Michal Hocko , David Rientjes , Dave Hansen , Ben Widawsky Cc: linux-kernel@vger.kernel.org, Andrea Arcangeli , Mel Gorman , Mike Kravetz , Randy Dunlap , Vlastimil Babka , Andi Kleen , Dan Williams , ying.huang@intel.com, Feng Tang Subject: [v2 PATCH 0/3] mm/mempolicy: some fix and semantics cleanup Date: Fri, 28 May 2021 22:07:00 +0800 Message-Id: <1622210823-61911-1-git-send-email-feng.tang@intel.com> X-Mailer: git-send-email 2.7.4 X-Rspamd-Queue-Id: 5C7EAE0004EE Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none); spf=none (imf21.hostedemail.com: domain of feng.tang@intel.com has no SPF policy when checking 192.55.52.120) smtp.mailfrom=feng.tang@intel.com X-Rspamd-Server: rspam04 X-Stat-Signature: hwaz57s4scz8r9gbt4mme4udghs7rzba X-HE-Tag: 1622210821-844951 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: Hi All, We've posted v4 patchset introducing a new "perfer-many" memory policy https://lore.kernel.org/lkml/1615952410-36895-1-git-send-email-feng.tang@intel.com/ , for which Michal Hocko gave many comments while pointing out some problems, and we also found some semantics confusion about 'prefer' and 'local' policy, as well as some duplicated code. This patchset tries to address them. Please help to review, thanks! The patchset has been run with some sanity test like 'stress-ng' and 'ltp', and no problem found. Thanks, Feng Changelogs: v2: * rename mempolicy_nodemask_intersects() to mempolicy_in_oom_domain() and correct commit log (Michal Hocko) * change the mpol syscall param sanity check (Michal Hocko) * combine the 3/4 and 4/4 in v1 into one patch, and further clean the logic (Michal Hocko) v1: * use helper func instead of macro for patch 2/4 (David Rientjes) * fix a possible null pointer case in patch 3/4 * update commit log for 1/4 RFC v2: * add for oom check fix patch 1/4 * add the unification patch for mpol preprocess 2/4 Feng Tang (3): mm/mempolicy: cleanup nodemask intersection check for oom mm/mempolicy: don't handle MPOL_LOCAL like a fake MPOL_PREFERRED policy mm/mempolicy: unify the parameter sanity check for mbind and set_mempolicy include/linux/mempolicy.h | 2 +- include/uapi/linux/mempolicy.h | 1 - mm/mempolicy.c | 205 ++++++++++++++++++++--------------------- mm/oom_kill.c | 2 +- 4 files changed, 103 insertions(+), 107 deletions(-)