From mboxrd@z Thu Jan 1 00:00:00 1970 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 C38B4C28D13 for ; Mon, 22 Aug 2022 23:16:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 22A576B0073; Mon, 22 Aug 2022 19:16:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D9D66B0074; Mon, 22 Aug 2022 19:16:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07A928D0001; Mon, 22 Aug 2022 19:16:07 -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 EC2D76B0073 for ; Mon, 22 Aug 2022 19:16:06 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B547DAB19E for ; Mon, 22 Aug 2022 23:16:06 +0000 (UTC) X-FDA: 79828788732.21.6A8BAF5 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf30.hostedemail.com (Postfix) with ESMTP id 4AD1180006 for ; Mon, 22 Aug 2022 23:16:06 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3E8D46137C; Mon, 22 Aug 2022 23:16:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D602CC433D7; Mon, 22 Aug 2022 23:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661210164; bh=+30wtA6kUnNmkh32zjo0SGqqgiEX2WoQWMpGybtQXM8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Pih6fV6Lq0yTYwgRO8tsGs3T3mhEF9XfpXMpZvjEnkVIwrlZttxYQ4lNpRhPRtT8Z MWHqevlIVR1QIwwd/5inWQ/2ZENw6zOUssx8JrXA+JHI8bFWCsiOWHcPsFTn0nhuH5 pCwJGypOrW7EJ77t/O8SbxYYPg9I+wr3y8QyTH0I= Date: Mon, 22 Aug 2022 16:16:03 -0700 From: Andrew Morton To: Yu Zhao Cc: Suren Baghdasaryan , Michal Hocko , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Minchan Kim , "Kirill A . Shutemov" , Andrea Arcangeli , brauner@kernel.org, hch@infradead.org, oleg@redhat.com, David Hildenbrand , Jann Horn , Shakeel Butt , Peter Xu , John Hubbard , shuah@kernel.org, linux-kernel , Linux-MM , linux-kselftest@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH RESEND v2 2/2] mm: delete unused MMF_OOM_VICTIM flag Message-Id: <20220822161603.9e19edfe2daaea3bf591910a@linux-foundation.org> In-Reply-To: References: <20220531223100.510392-1-surenb@google.com> <20220531223100.510392-2-surenb@google.com> <20220822152119.96d40c884078229ee3e6b25e@linux-foundation.org> <20220822154822.366a9e4527b748cf99d98637@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661210166; a=rsa-sha256; cv=none; b=5HDtUeDXMFVnPgfDQzW/ybShM2B2jcCP393D/cTBZVbY9lMyk+lcTVMBSy/TH6yEGDTZag 321adsoPICN3Yk44CHuZNihVgDFp71XtINZl1vLyP3naO6mCvnnLN9vv/CK4147Djq56uj UlruD0XqtfzipcUdEylQwfQJnIHw/Ak= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Pih6fV6L; spf=pass (imf30.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661210166; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=630eqtq0D4+PBZwzev1PuRn4syxdJFvrnRnFH8iZlgc=; b=yeVNLDfv6/zEMC5i9vFfG9+L34p5ztbUnto93TLQ0l9dQq7S3bsbHX1o+gdJ5Om5CzgJWs SVcXqWEAdDn0Rcj0eoxvMAvz1mUEwKGlmJ0TWKOdX9Do9zKo4qf/9ewF8WVj9fpKB4RrWM a5aBDCMnN8nBC/ZDVqvpSCxCqvu/VS4= X-Stat-Signature: xssmm6p9b9mjgfyjwqs4b6ce8m6ktech X-Rspamd-Queue-Id: 4AD1180006 X-Rspamd-Server: rspam11 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Pih6fV6L; spf=pass (imf30.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1661210166-318320 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: On Mon, 22 Aug 2022 16:59:29 -0600 Yu Zhao wrote: > > > @@ -4109,7 +4109,7 @@ static int walk_pud_range(p4d_t *p4d, unsigned > > > long start, unsigned long end, > > > > > > walk_pmd_range(&val, addr, next, args); > > > > > > - if (mm_is_oom_victim(args->mm)) > > > + if (test_bit(MMF_OOM_REAP_QUEUED, &args->mm->flags)) > > > return 1; > > > > > > /* a racy check to curtail the waiting time */ > > > > Oh. Why? What does this change do? > > The MMF_OOM_REAP_QUEUED flag is similar to the deleted MMF_OOM_VICTIM > flag, but it's set at a later stage during an OOM kill. > > When either is set, the OOM reaper is probably already freeing the > memory of this mm_struct, or at least it's going to. So there is no > need to dwell on it in the reclaim path, hence not about correctness. Thanks. That sounds worthy of some code comments?