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 AF137C433F5 for ; Tue, 17 May 2022 03:12:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4C098D0005; Mon, 16 May 2022 23:12:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DFB0C8D0003; Mon, 16 May 2022 23:12:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9CAA8D0005; Mon, 16 May 2022 23:12:17 -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 B7BFC8D0003 for ; Mon, 16 May 2022 23:12:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 84CE4BCB for ; Tue, 17 May 2022 03:12:17 +0000 (UTC) X-FDA: 79473761514.07.988B8FA Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by imf03.hostedemail.com (Postfix) with ESMTP id 50B362003E for ; Tue, 17 May 2022 03:12:07 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id q203so2202429iod.0 for ; Mon, 16 May 2022 20:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1kuEDxhPJAEoL+pT1AeoocUUxdiiHKoBFkSkZvL+zTE=; b=MwI1QIx35vX1X2b4JzO+XSYcC0c4I+ihLcGgCP6FK2jTm+GGZFCJDhuTGoAPBkQLc/ VW948CJ7molBxVHIVACnnWLmYIcBSm2Qc3oRv99jfBAgesfc9SnMAvypFVgkF6kyClmo dfxqT2Iih3GWPQIpZYCe2qJpofO9HFUQmQD1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1kuEDxhPJAEoL+pT1AeoocUUxdiiHKoBFkSkZvL+zTE=; b=oR+h+RuDa+TF5Rc4E5r77ZKLk+JkPP9QBoxHVjXwA6VJDJ7/+poXrpgd9wsQdnkth6 fiIKZHQSsERuSY874bkxoiO4AaOrUaGSqk7pHkS3PJ50KIxOHxPcnOrGSl2An7wxgye6 LpICbXXFSlPXotzfKyD1zuIMq+vFZ+3NGyebOzTGWvNmopiW6jmLaWxvPVHTmo26hGzm 9ymmpLHxS4Vcw76varirrdA/2gLE1K2LJswsJJeoFrpuZM//DzhcjTLbkG9uYJvJzwof rTYKMfa6b60QufSzi+RY3rvvIhVFDOYW14WYMQpKNVGkyKTBodlJHWKWrgWqdie/svz4 MaIw== X-Gm-Message-State: AOAM530z0Yl3xtb1j80wlJXr5OPfv2T/zwaWeHj00khOoy+OPUGUz2/t TeUAf6M1Ri2hRzqOlfpQMuBcnw== X-Google-Smtp-Source: ABdhPJyKur7KEmswRvvVt7T+HSxN6g34XcNeFHOa9PWInnFFz3vXE+rekPH9pYMo+VYF9f0Xl/sBlA== X-Received: by 2002:a05:6638:3397:b0:32b:a9da:9603 with SMTP id h23-20020a056638339700b0032ba9da9603mr10415917jav.283.1652757136387; Mon, 16 May 2022 20:12:16 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id f19-20020a056638329300b0032e102760c5sm2458323jav.73.2022.05.16.20.12.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 May 2022 20:12:15 -0700 (PDT) Subject: Re: [PATCH v2 1/2] mm: drop oom code from exit_mmap To: Suren Baghdasaryan , 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, kernel-team@android.com, Shuah Khan References: <20220516075619.1277152-1-surenb@google.com> From: Shuah Khan Message-ID: <66da8e2f-62e5-2a09-e8ad-960d77bde75c@linuxfoundation.org> Date: Mon, 16 May 2022 21:12:14 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220516075619.1277152-1-surenb@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 50B362003E X-Stat-Signature: 31n7cpmx6uu4zeby6pax1qj4r1zidk9g Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=MwI1QIx3; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf03.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.41 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1652757127-873639 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/16/22 1:56 AM, Suren Baghdasaryan wrote: > The primary reason to invoke the oom reaper from the exit_mmap path used > to be a prevention of an excessive oom killing if the oom victim exit > races with the oom reaper (see [1] for more details). The invocation has > moved around since then because of the interaction with the munlock > logic but the underlying reason has remained the same (see [2]). > > Munlock code is no longer a problem since [3] and there shouldn't be > any blocking operation before the memory is unmapped by exit_mmap so > the oom reaper invocation can be dropped. The unmapping part can be done > with the non-exclusive mmap_sem and the exclusive one is only required > when page tables are freed. > > Remove the oom_reaper from exit_mmap which will make the code easier to > read. This is really unlikely to make any observable difference although > some microbenchmarks could benefit from one less branch that needs to be > evaluated even though it almost never is true. > > [1] 212925802454 ("mm: oom: let oom_reap_task and exit_mmap run concurrently") > [2] 27ae357fa82b ("mm, oom: fix concurrent munlock and oom reaper unmap, v3") > [3] a213e5cf71cb ("mm/munlock: delete munlock_vma_pages_all(), allow oomreap") > > Signed-off-by: Suren Baghdasaryan > Acked-by: Michal Hocko > --- Looks good to me. Reviewed-by: Shuah Khan thanks, -- Shuah