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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CCDEC433F5 for ; Thu, 11 Nov 2021 09:20:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BC15061264 for ; Thu, 11 Nov 2021 09:20:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BC15061264 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 4066A6B0075; Thu, 11 Nov 2021 04:20:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 38F0F6B007E; Thu, 11 Nov 2021 04:20:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 230AE6B0080; Thu, 11 Nov 2021 04:20:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 147746B0075 for ; Thu, 11 Nov 2021 04:20:43 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BCD7583C3B for ; Thu, 11 Nov 2021 09:20:42 +0000 (UTC) X-FDA: 78796104324.24.6AB7170 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf07.hostedemail.com (Postfix) with ESMTP id B603B10004DE for ; Thu, 11 Nov 2021 09:20:38 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 553FD21B35; Thu, 11 Nov 2021 09:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1636622437; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VKcDr2fKCQCckd3lBGavIW/Vf9CpVRyHsHkDbRYBxl4=; b=KPkrH2PbhZsBvSh275iz8ij3LnsQNcUkX8VhPI9+7SbFZKgx6+tXzz6Zv1yL7Qj80WxH0M +vuuVBq75iQHbByg/cH50cnIwEBFMEaWmCIBiaXhbpt7IUFlYUZR8N1cRqdHf5YJt0en0s mrodPCnwLfpm4N6p1p1ACTlkJsY7B+k= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 03AABA3BF2; Thu, 11 Nov 2021 09:20:36 +0000 (UTC) Date: Thu, 11 Nov 2021 10:20:36 +0100 From: Michal Hocko To: Suren Baghdasaryan Cc: Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Christoph Hellwig , Oleg Nesterov , David Hildenbrand , Jann Horn , Shakeel Butt , Andy Lutomirski , Christian Brauner , Florian Weimer , Jan Engelhardt , Linux API , linux-mm , LKML , kernel-team , "Kirill A. Shutemov" , Andrea Arcangeli Subject: Re: [PATCH 1/1] mm: prevent a race between process_mrelease and exit_mmap Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B603B10004DE X-Stat-Signature: tz7d1obemc3bqqkeaqt3ags6d5soocjx Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=KPkrH2Pb; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf07.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1636622438-767305 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 Wed 10-11-21 17:49:37, Suren Baghdasaryan wrote: > On Tue, Nov 9, 2021 at 1:10 PM Suren Baghdasaryan wrote: > > > > On Tue, Nov 9, 2021 at 12:10 PM Michal Hocko wrote: [...] > > > Yes, those can run concurrently. One thing I completely forgot about is > > > 27ae357fa82b ("mm, oom: fix concurrent munlock and oom reaper unmap, v3") > > > which is about interaction with the munlock. > > Agrh! This interaction with the munlock you mentioned requires us to > take mmap_write_lock before munlock_vma_pages_all and that prevents > __oom_reap_task_mm from running concurrently with unmap_vmas. The > reapers would not be as effective as they are now after such a change > :( __oom_reap_task_mm will not run concurrently with unmap_vmas even with the current code. The mmap_sem barrier right before munlock code prevents that. -- Michal Hocko SUSE Labs