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 D5B56C433EF for ; Tue, 4 Jan 2022 22:25:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69C566B0071; Tue, 4 Jan 2022 17:25:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 624CD6B0073; Tue, 4 Jan 2022 17:25:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49FCC6B0074; Tue, 4 Jan 2022 17:25:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 3930C6B0071 for ; Tue, 4 Jan 2022 17:25:03 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E81D1181C9D44 for ; Tue, 4 Jan 2022 22:25:02 +0000 (UTC) X-FDA: 78994036044.30.724DF75 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by imf27.hostedemail.com (Postfix) with ESMTP id 35F6440003 for ; Tue, 4 Jan 2022 22:25:01 +0000 (UTC) Received: by mail-yb1-f182.google.com with SMTP id w13so78455862ybs.13 for ; Tue, 04 Jan 2022 14:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M1QBXQhRunHeAehYIycTouhYj3cWM9KC3mhyXs9mkLo=; b=o6v1LBQqqRQ1zjkCWy52ZvZ0ojpbkR7cq552qjmx+/nvTq0KeEc9jgIvIn5OXCyCw4 Wh18TNUQ1uRdDTNTa7GgXUsrFmDVynzlWfVfJaxwdtofFJffId8VrkGYZDle6e7UzHwr 9X+6zEXV396nLI1t3jmCR/DzYW25hLBvbl+c+hXlGDvwphF14U0K8bzyIm4wsWHJKGid 20qhKJAOv1YyhM1yl8kqN96nSoBLcOzC3hrI5hfA76i+tvYc2hkgSm2cY2C9VkMS1O4T OsOcE1YxbzzzMN3QpLkmsmSB+tln/Ux7x5l5fK/LBMDfVpxUZk9Q+9LKT051MpTA0J91 dhoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M1QBXQhRunHeAehYIycTouhYj3cWM9KC3mhyXs9mkLo=; b=OXhXq6DPdVXHqcAy1oxAJh5KBf0lwkeg3Qn5n9pWCFo28krjhPk84MK0FGRSdP67Qe 0tj/ePVUZxGITjb5HzOZBu1NXFDMCZTrH4dntSrLBiCwX9bnvKR80aj4nj3hOhCYVIIt +wbgbAQY2YE+ABsJo7ZOUoip/FCgZqH/I3yFAEH7Qlb213E4SYRga7YL+y9FjNWcQHU1 qVT4+F4A1dLvOReg6YUj22tk46ih5OSzkRlKgfda66ogjwpuvxkuwAi2XGQabLKoODlu SdFt7eZalGadAobokgtYsZF4dSTZAuHA8lr30smBTyzqE6EtmshKkMicDZnJHjR+o5ju JRVw== X-Gm-Message-State: AOAM530up15YieC+QYY/Alo8Ygwsuxs9IICu2rNXE/NdCaBGztdqQn0r w+Te53ouax7Ve0Jd8lQQrMhm8pb0iwOtueDywMfiAg== X-Google-Smtp-Source: ABdhPJzq5ogUegZNf9ozNumlO/uYc6UTXT6bPaLKzFqUs0x82NmJYMfbRfSmN21Zgp2e6BfQHjNyHZidvdhDPxj0jjg= X-Received: by 2002:a25:d109:: with SMTP id i9mr49121946ybg.1.1641335101172; Tue, 04 Jan 2022 14:25:01 -0800 (PST) MIME-Version: 1.0 References: <35c340a6-96f-28a0-2b7b-2f9fbddc01f@google.com> In-Reply-To: <35c340a6-96f-28a0-2b7b-2f9fbddc01f@google.com> From: Suren Baghdasaryan Date: Tue, 4 Jan 2022 14:24:50 -0800 Message-ID: Subject: Re: [PATCH 4/3] mm: drop MMF_OOM_SKIP from exit_mmap To: Hugh Dickins Cc: Michal Hocko , Johannes Weiner , Andrew Morton , David Rientjes , Matthew Wilcox , Roman Gushchin , Rik van Riel , Minchan Kim , "Kirill A. Shutemov" , Andrea Arcangeli , Christian Brauner , Christoph Hellwig , Oleg Nesterov , David Hildenbrand , Jann Horn , Shakeel Butt , Andy Lutomirski , Christian Brauner , Florian Weimer , Jan Engelhardt , Tim Murray , Vlastimil Babka , linux-mm , LKML , kernel-team Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 35F6440003 X-Stat-Signature: h4sej1wqyj7ro8gb49jo4xc869mhcrt6 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=o6v1LBQq; spf=pass (imf27.hostedemail.com: domain of surenb@google.com designates 209.85.219.182 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1641335101-494675 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, Jan 3, 2022 at 1:16 PM Hugh Dickins wrote: > > On Mon, 3 Jan 2022, Michal Hocko wrote: > > On Thu 30-12-21 09:29:40, Suren Baghdasaryan wrote: > > > On Thu, Dec 30, 2021 at 12:24 AM Michal Hocko wrote: > > > > > > > > It would be really great to make unlock_range oom reaper aware IMHO. > > > > > > What exactly do you envision? Say unlock_range() knows that it's > > > racing with __oom_reap_task_mm() and that calling follow_page() is > > > unsafe without locking, what should it do? > > > > My original plan was to make the page lock conditional and use > > trylocking from the oom reaper (aka lockless context). It is OK to > > simply bail out and leave some mlocked memory behind if there is a > > contention on a specific page. The overall objective is to free as much > > memory as possible, not all of it. > > > > IIRC Hugh was not a fan of this approach and he has mentioned that the > > lock might not be even really needed and that the area would benefit > > from a clean up rather than oom reaper specific hacks. I do tend to > > agree with that. I just never managed to find any spare time for that > > though and heavily mlocked oom victims tend to be really rare. > > I forget when that was, and what I had in mind at that time. > But yes, by now I am very sure that munlocking needs a cleanup. > > And I do have that cleanup (against a much older tree), but never > the time to rebase or post or shepherd it through N revisions. How old was that tree? > > It was 22 files changed, 464 insertions, 706 deletions: > which is too much to help with this immediate oom reaper question. > > I'd better not drive this discussion further off-course; but it pains > me to see munlock_vma_pages obstructing, knowing there's a better way. > > I wonder: what if I were to steal time and promise to post a > rebased series against 5.17-rc1 or rc2: not support it thereafter, > but might there be someone to pick it up and shepherd it through? > But there's no answer to that, without you seeing what it's like. I would be interested in taking a look and see if it can be upstreamed and supported without bugging you too much. Thanks, Suren. > > Hugh