From patchwork Sat Jun 23 14:12:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?56a56Iif6ZSu?= X-Patchwork-Id: 10483641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B738604D3 for ; Sat, 23 Jun 2018 14:13:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E56C28C3C for ; Sat, 23 Jun 2018 14:13:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 524F128C7B; Sat, 23 Jun 2018 14:13:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9197828C3C for ; Sat, 23 Jun 2018 14:13:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9EAB6B0003; Sat, 23 Jun 2018 10:13:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E27676B0005; Sat, 23 Jun 2018 10:13:12 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC9366B0006; Sat, 23 Jun 2018 10:13:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f70.google.com (mail-pl0-f70.google.com [209.85.160.70]) by kanga.kvack.org (Postfix) with ESMTP id 86B836B0003 for ; Sat, 23 Jun 2018 10:13:12 -0400 (EDT) Received: by mail-pl0-f70.google.com with SMTP id d6-v6so5263735plo.15 for ; Sat, 23 Jun 2018 07:13:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=TrypbCDZKuim9Od/iCHNAQKGhgD1CxB9oz/uU8r0S3k=; b=HKLrvds939ayInU2ClRM2MSsOFcv5rJc542mYA2mFk8yUK2AnQICL51ymsu0XPCHqX H5PrUYgOyWWdOz8MjiE5mHKIeM+E50nrAhKjlDJ2B4hvzLI1r07NCTcCqsWFAIPLyIZe H84OaY0WHDHbsqPt4dKhuJSDX6HmTs+vRYfBB9fRt3t7SbQ4NI479+o6dty4yPZO03ko KEFsjQn4/iMS73VTs3rwH2r7PdrZPSmSpQ5Obp7DNLjFdXlDlwfx6PeCLNvQ18JMY9HK +UVRB5GVDewsOwcdu40O3ASa/1yQ05NMUvd5ZyxGh7dpiIKM8+CLHpuaurmmuR53CvuO ryqA== X-Gm-Message-State: APt69E3vgdA/qzijtCrVtzQeFwhVDaAljjKE14GNr+W0Ox+IIIDtQd6f v1sNnROxqjYTm9ZfocIMrHelYsGQx7N0jL7gLik3NzUgWfZu9/8wBsYZAQDh+Osm/vQNK4iXIRg e88OQzQoYvxoi5M5fOjvsIICO2LxMGi9UieY9kRGWqyY0IvOuMRK6uUQpVuK8RUM/ybR7QHGBTU 6Udl51KO6IKsl+3LFdNFSOc8PQwqNUIa7rxmoQ0/5QPXOb4oe6o0kzxsPcBUFuWcFR0a5kY/pbB gmZAQBylFseSfeZm6wkiqQRjzJPVI8jg/4SRq1EAiJcZn3psIMsD4ANIhZhRTsgBBZZ+xLsJcn8 zVVmq/xLi8k8L4pRLQht96GbMXjsQ1iSwsnpdT6U3lk5RL/DpwHr9G3GM2ViNb1GXcCnkprbAnY x X-Received: by 2002:a63:9702:: with SMTP id n2-v6mr4905372pge.88.1529763192184; Sat, 23 Jun 2018 07:13:12 -0700 (PDT) X-Received: by 2002:a63:9702:: with SMTP id n2-v6mr4905331pge.88.1529763191319; Sat, 23 Jun 2018 07:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529763191; cv=none; d=google.com; s=arc-20160816; b=oNs/fOkMe0Pv3+IEXns9soJQLSNEKlgY1KYCVk2Cr1ud0aDL25u7uRM8JitfdmKLtN GbdmDGYTYjpCIzRWPsd8WXDt6uGTK+ysi1EBnvuuGSfimojXI9ldciQrlXTj1PbsowdI v+SylLbgjUb/O02Tl3RJfyfUMny0B8TDldmBEy/EnI69oXx1gApjACwLGofkG4b5c94t yYID03oLRu30Gsnb+vl3dLoPyoVk43bCAqFmtlWrYqo3lmjCzgaRRWPB2S9cJ/+HO+CS HD5jC8h4HLQNJgAbAB8cvveyhAW5u7cvRncgJGDzQG2DaNwfOYBH7ichnQ38NG4VGIuc WPFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=TrypbCDZKuim9Od/iCHNAQKGhgD1CxB9oz/uU8r0S3k=; b=fkBka9pMD8kzLZ8msenUCeqQlOPEe1xrWQGLaPIJHSMX5It9fN32scZ8QqtYu92F/5 8CJzGPrnR2lV/RBjpdJksoE7WLEL1ycugZUQCESw0Oq42Vc9TX0m0cXTzK0g6mDWziQi BnmLYLM8WRNX6w5ZV/bRctdwg3L7SRCOy8thIeae+aZETW6b7yiKTL52yCEIX4O9xNYh raQrlmGbPTGbEauwWTXPwBSMgtKBtbR1SqU9J4w+VdYwyrnJxyDGofAnl6ovdLxB9sz+ 4toKx0kcqF7uwQcnaPq8CM7+ACbSVr635ba+ydUCj13DdY6xfB4mzo9Xr/vuwCFSu8LY mbMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vXRuuZVv; spf=pass (google.com: domain of ufo19890607@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=ufo19890607@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u29-v6sor2910437pfa.125.2018.06.23.07.13.11 for (Google Transport Security); Sat, 23 Jun 2018 07:13:11 -0700 (PDT) Received-SPF: pass (google.com: domain of ufo19890607@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vXRuuZVv; spf=pass (google.com: domain of ufo19890607@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=ufo19890607@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=TrypbCDZKuim9Od/iCHNAQKGhgD1CxB9oz/uU8r0S3k=; b=vXRuuZVvbYDJzAwgcshGvRSF0jxzJiQr0XppUwkFgO0etGuSO1s+EMUJeilfgY9GWf IMfz2c6gooaqvxVjHSmdDWVGzKjAtLCzkXkF0ETZiXY27sb8L8ZSVHquh+Zw2u+2Ohil cJuCUMolSMzI/GDv8baDV/Gm+eTZhdHFN+bB9Oms+JrnsY4QrxMlBBiW9tpA4bVIgyim fNhouP1qGg75cotvMLuUUv3jW3hXMP3g/k6fmJiqA5iGZJv8MHqIjBYKA3LKysSGdYTl qqXtKN98BlEhOGyfDpNBBbQQ0nxytD5YR0xG+bzKeOLou8qYhSnSHYnVI8nWs7kU40ar dgjg== X-Google-Smtp-Source: ADUXVKI2bXf6SB7auV+tpkGqa7O6SLTC3RvZnCYsbHooZ9aQJwQJvN+9oMVMB+JgEFbW+xLvNce2rg== X-Received: by 2002:a62:5601:: with SMTP id k1-v6mr6066126pfb.212.1529763190901; Sat, 23 Jun 2018 07:13:10 -0700 (PDT) Received: from dest.didichuxing.com ([52.229.160.192]) by smtp.gmail.com with ESMTPSA id v78-v6sm21851120pfd.64.2018.06.23.07.13.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jun 2018 07:13:09 -0700 (PDT) From: ufo19890607@gmail.com To: akpm@linux-foundation.org, mhocko@suse.com, rientjes@google.com, kirill.shutemov@linux.intel.com, aarcange@redhat.com, penguin-kernel@i-love.sakura.ne.jp, guro@fb.com, yang.s@alibaba-inc.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, yuzhoujian@didichuxing.com Subject: [PATCH v10 1/2] Move enum oom_constraint in oom.h Date: Sat, 23 Jun 2018 22:12:50 +0800 Message-Id: <1529763171-29240-1-git-send-email-ufo19890607@gmail.com> X-Mailer: git-send-email 1.8.3.1 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: X-Virus-Scanned: ClamAV using ClamSMTP From: yuzhoujian This patch will make some preparation for the follow-up patch: Refactor part of the oom report in dump_header. It puts enum oom_constraint in oom.h. Signed-off-by: yuzhoujian --- include/linux/memcontrol.h | 1 + include/linux/oom.h | 7 +++++++ mm/oom_kill.c | 7 ------- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 6c6fb116e925..513b74b3115b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/include/linux/oom.h b/include/linux/oom.h index 6adac113e96d..40cc561f8557 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h @@ -15,6 +15,13 @@ struct notifier_block; struct mem_cgroup; struct task_struct; +enum oom_constraint { + CONSTRAINT_NONE, + CONSTRAINT_CPUSET, + CONSTRAINT_MEMORY_POLICY, + CONSTRAINT_MEMCG, +}; + /* * Details of the page allocation that triggered the oom killer that are used to * determine what should be killed. diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 84081e77bc51..1045c5bc7c37 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -237,13 +237,6 @@ unsigned long oom_badness(struct task_struct *p, struct mem_cgroup *memcg, return points > 0 ? points : 1; } -enum oom_constraint { - CONSTRAINT_NONE, - CONSTRAINT_CPUSET, - CONSTRAINT_MEMORY_POLICY, - CONSTRAINT_MEMCG, -}; - /* * Determine the type of allocation constraint. */