Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5788189iob; Tue, 10 May 2022 03:49:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3agqxVfcFt8Pj0I7tj342zZSthz11uVNzsRCprAssxpyUAfB9zAKqDxo/QpFBVB2SmNOI X-Received: by 2002:a17:907:7f26:b0:6f4:69c:196f with SMTP id qf38-20020a1709077f2600b006f4069c196fmr18387731ejc.613.1652179752083; Tue, 10 May 2022 03:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652179752; cv=none; d=google.com; s=arc-20160816; b=yxjg+6lzkWecnhrQF4hVLSFGsymLIeheCt6kmpbfnGbV7uy+kShMDo9TDOeEMIMjxV Bf7dxTVfmXYRmDpm0RKjxCYtm/vWTV1VDdEVGspEFnZGWzNW+8QMvRexbqnTT3K6+2yx xwHx0H98rI89/m0uJDpdq0KLNaLKqE4EB6GEkOoJDtzqIWWFm2k12j2iLAJMDOf0g+SN ajFaYqLcYXCtuVystIjHCUu/YpR+wlrrs362Fr7qi39OQTzrH4bdn2Oj49pea67Mnoov Ns1KUvtAaor91V8m0IBcWKCdEPWpcOOMOWaZqPyCnZpcpuW5LlKqbmaK7B9rZGXohiZM OeKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=v8x+eJcpkdL63Ie+naoRJ5K0tY4VeOqZU3kdjwItKXU=; b=c+6ah0vZtBBJ8wlgo0W2TUnOYPl2kZEn4fJMkCF/2InV2f9kRGFRRcVzY+6V38/i4V 5cOArSuRhyrd0xjiUi8CP6/IJrc6CCgqO5M6xwcUnOyLkEuaU9uTpHum3+D6VYN1ASPt alEa3H+U//4DY7rHxwfPy076PpTNNMuI4MgybowOEOtrHpQ/dOMPQx5KU6cE9YJ9jKWy 1/W5pFoEPPvAcxJEhIdzpO3cHnBeleSfeR9+f8k7yGS3xIJTYc/yns4QnhDyLz9zxB4X jjFFVa3dflTi3Ir9LCITPXPhuDJLCKR9a1rHAX9QKw02CSS7fNQyv9g31J9guXdlyXl2 p7zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="tQbZ/WVD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot1-20020a170906ccc100b006e4b4044b0csi15625872ejb.869.2022.05.10.03.48.48; Tue, 10 May 2022 03:49:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="tQbZ/WVD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234827AbiEJDEd (ORCPT + 99 others); Mon, 9 May 2022 23:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235061AbiEJDEW (ORCPT ); Mon, 9 May 2022 23:04:22 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 857492878C4 for ; Mon, 9 May 2022 20:00:24 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id v17-20020a056902029100b006484d85132eso13637295ybh.14 for ; Mon, 09 May 2022 20:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=v8x+eJcpkdL63Ie+naoRJ5K0tY4VeOqZU3kdjwItKXU=; b=tQbZ/WVD3zHYzCMARi8lOIW6XMFgAqOYrHo1j1YMjmf1E6Db2YUEzn7zBhUfO02eJR uNsGGz9W6xVLA1AYHmS5NuZ7r/mRzpYH2Hnx/tmOtgNec150hi0ujhXc1tediKwiGf/h EPXp+GS+9N1Qw/QPsn0+c2TSoT9Gnu2f45AOpRYTz9Q7W6nM8VTqau2PAaYWtx/57eQc sCO4QD6WawO8xsNiG1kegbzuCNfwShl9YZ7etBeoKA2AtPazAPjk+4gc+G0GOH9R0oiT M2apOyLag5zgEmw+/WD/CZ9WQgMbVbFWjv93NsBsofE2y3+wrl4wEPRuAGpdMDyRRL5D oFew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=v8x+eJcpkdL63Ie+naoRJ5K0tY4VeOqZU3kdjwItKXU=; b=f0k+4u7H6fQGT9Cb6ZlAUpp8qMmA+e98udEcsJGKdf/7jubDRhao5yubuBUNfXcNfH wlWmu1yih4c+PqlSYJCLnaFSV7l+6b9mnEyXUoKOD1k5H3uiBnofNbutlWqqMW3f0Sx8 GfnT0U0McyhSU6CyVJcblxwC7SfCHluakA6JY42gXIKz+nqceH3BwtlWcBPOifLlu6Vj uaf/GzeNoanGHjmcxTABruQQF3NTJfdetgSgdVfGIsvpyOOakuSr2DDxZNObUEhGa4R7 jT/Kmue0YKwHPCCyDH0PFsO5JEHLAKhNOF3SdbejmEZmhneFYoF0B7D7ooh3iUCYzVBn +23A== X-Gm-Message-State: AOAM532BAyINaW3KIfN2uumDbTABmJRvp0aGiYdFtmWCc+0dA6h8pJh2 bc5z7I7z1Iqm5gYRRsPRpfHf4PgFzLs= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:200:c861:f04:adab:761b]) (user=surenb job=sendgmr) by 2002:a81:342:0:b0:2f8:a36c:1ddd with SMTP id 63-20020a810342000000b002f8a36c1dddmr17464093ywd.505.1652151623732; Mon, 09 May 2022 20:00:23 -0700 (PDT) Date: Mon, 9 May 2022 20:00:14 -0700 In-Reply-To: <20220510030014.3842475-1-surenb@google.com> Message-Id: <20220510030014.3842475-3-surenb@google.com> Mime-Version: 1.0 References: <20220510030014.3842475-1-surenb@google.com> X-Mailer: git-send-email 2.36.0.512.ge40c2bad7a-goog Subject: [PATCH 3/3] mm: delete unused MMF_OOM_VICTIM flag From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: mhocko@suse.com, rientjes@google.com, willy@infradead.org, hannes@cmpxchg.org, guro@fb.com, minchan@kernel.org, kirill@shutemov.name, aarcange@redhat.com, brauner@kernel.org, hch@infradead.org, oleg@redhat.com, david@redhat.com, jannh@google.com, shakeelb@google.com, peterx@redhat.com, jhubbard@nvidia.com, shuah@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, surenb@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the last usage of MMF_OOM_VICTIM in exit_mmap gone, this flag is now unused and can be removed. Signed-off-by: Suren Baghdasaryan --- include/linux/oom.h | 9 --------- include/linux/sched/coredump.h | 1 - mm/oom_kill.c | 4 +--- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/oom.h b/include/linux/oom.h index 6cdf0772dbae..25990e9d9e15 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h @@ -77,15 +77,6 @@ static inline bool tsk_is_oom_victim(struct task_struct * tsk) return tsk->signal->oom_mm; } -/* - * Use this helper if tsk->mm != mm and the victim mm needs a special - * handling. This is guaranteed to stay true after once set. - */ -static inline bool mm_is_oom_victim(struct mm_struct *mm) -{ - return test_bit(MMF_OOM_VICTIM, &mm->flags); -} - /* * Checks whether a page fault on the given mm is still reliable. * This is no longer true if the oom reaper started to reap the diff --git a/include/linux/sched/coredump.h b/include/linux/sched/coredump.h index 4d9e3a656875..746f6cb07a20 100644 --- a/include/linux/sched/coredump.h +++ b/include/linux/sched/coredump.h @@ -70,7 +70,6 @@ static inline int get_dumpable(struct mm_struct *mm) #define MMF_UNSTABLE 22 /* mm is unstable for copy_from_user */ #define MMF_HUGE_ZERO_PAGE 23 /* mm has ever used the global huge zero page */ #define MMF_DISABLE_THP 24 /* disable THP for all VMAs */ -#define MMF_OOM_VICTIM 25 /* mm is the oom victim */ #define MMF_OOM_REAP_QUEUED 26 /* mm was queued for oom_reaper */ #define MMF_MULTIPROCESS 27 /* mm is shared between processes */ /* diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 36355b162727..11291b99599f 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -732,10 +732,8 @@ static void mark_oom_victim(struct task_struct *tsk) return; /* oom_mm is bound to the signal struct life time. */ - if (!cmpxchg(&tsk->signal->oom_mm, NULL, mm)) { + if (!cmpxchg(&tsk->signal->oom_mm, NULL, mm)) mmgrab(tsk->signal->oom_mm); - set_bit(MMF_OOM_VICTIM, &mm->flags); - } /* * Make sure that the task is woken up from uninterruptible sleep -- 2.36.0.512.ge40c2bad7a-goog