From patchwork Tue May 10 03:00:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 12844444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7E00C433F5 for ; Tue, 10 May 2022 03:00:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51E6B8D0001; Mon, 9 May 2022 23:00:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 47CE96B0075; Mon, 9 May 2022 23:00:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F8F78D0001; Mon, 9 May 2022 23:00:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1F6FB6B0074 for ; Mon, 9 May 2022 23:00:25 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E10E320C8D for ; Tue, 10 May 2022 03:00:24 +0000 (UTC) X-FDA: 79448329968.15.EE49703 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf24.hostedemail.com (Postfix) with ESMTP id C5E541800C4 for ; Tue, 10 May 2022 03:00:16 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id z14-20020a5b0b0e000000b0064848b628cfso13678335ybp.0 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=s7IqL7oQYBfJUFNkCzI8lGq/olgF2dPU0IVM3aNREvZdULLtk56Eat3LgYW+md3QbV KQp8GFPch6jKqFIRs7eA+0ZiI/pFOdTc7+PUvh9oxAk/dGG9wHaAnPikYjsPU6t+wBVB Ochf8PbqnCuLgtG9rq66YQR7PiJc2pCy63JH1AZUflUsUVfJocdLtnh46CMRanptzkfs SjpT8fdunARtnJuJh0L4RLOWaFnRddUb+XH72Nf+/uN3EvmAG58C9EzjEID8hitZPj12 i9cfihRhaKoZoGQ9MMkKocciSgzdYAiUqb/anESzbvHttlqXZMO7BP8pOPGKh5UvUjAx imZQ== X-Gm-Message-State: AOAM533oO1yDwHDExL1YWdo7YJwGwgOFFwcVu3orh7au46vVoxXwB4R3 vINGUYfR9Cq+YIcmbUoKnzPrQX/jItc= X-Google-Smtp-Source: ABdhPJwPgNaVr9a+2gxmOd31MQgAEbhuyPy+GMIaxiFaw1vY5fiRw6vfJCoJcKJvO7YSwWHFwedVmy6Y5vo= 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 X-Stat-Signature: on44k3q7ffuwri1bpff3xr7g1t7xozyt X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C5E541800C4 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="tQbZ/WVD"; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf24.hostedemail.com: domain of 3R9V5YgYKCPImolYhVaiiafY.Wigfchor-ggepUWe.ila@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3R9V5YgYKCPImolYhVaiiafY.Wigfchor-ggepUWe.ila@flex--surenb.bounces.google.com X-HE-Tag: 1652151616-447362 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: 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 Acked-by: Michal Hocko --- 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