Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796372404; b=VOEkpsuT2Y08qXoJi0gFg7IKtpkSS/sxnJk3nXssz2FYoBaiz1t9Hvxg8wqC5AsGoA30 QzGZMZgSFKI9tapoRNOzPWIEGVXKATDzfYJNMTAQh/3ut6uzY52QQG1KtJzVSaVkXO1i5 VDNOXb7nsCB5JcsMUa1LrnBQvRl7yayiQGcnvpLuY42diHXjwByyJ5HbEajlJGBcFsKfN gs80+qp7fKlr2khzbVVdlQE09W/abdEWK/oKB84zdfXHKkKQfc2+9fy6tJl+6kpuqOxB1 uyf5bfr75WNHHhsPCpszx6FkGwg3wNQm79PhmK35c2+Wc1S1zh7BkBcFObEiIXMVsKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796372404; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=NziZmdpOMD8l0d2yGCnII08SrWmuy7lrep13r52Ww9A=; b=AEusTkbQTbpG+C77QiVBwY7M2WdpsFd5WOtvXb4yf1C5tNxz1nXe/HjjW1NJ82zWAnHp PS2c/G4+CgG1GKWuHUWdkdnjxzWfc4HiNkfrnOEvvfLwuiIm8mXsuKuaWNxUVKOhwI1/0 Z/NOBPwRLLz68kl+yGXIEqlAatDYhQaMhiDNhzmqWIdwZve61VDvDOV/QilFcYE2bd5W2 IYmnn5tLKw472wJ/itduTz21GCJRgcEJmscf7h+ELn+QweB1KlO/Wyp2LSecTFd74Q7hJ qmkn9BynalTFE77wJkBM9sz4lMUP+nG48MtoE/Cky++YGm7poYjdN09DpNrTCyUf/7A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b="FW5x/9m7"; arc=none smtp.remote-ip=209.85.128.43 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8641D606A322 for ; Fri, 4 Dec 2026 08:20:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8641D606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=FW5x/9m7 Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4bb70074ab2so3048065e9.0 for ; Fri, 04 Dec 2026 00:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1796372403; x=1796977203; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=NziZmdpOMD8l0d2yGCnII08SrWmuy7lrep13r52Ww9A=; b=FW5x/9m7V9NFmopt0kYhvpBVQtJKc3D4l7ilGNXctWdOF+V22DDaHKiAKpcICtmiXz Gqyf0XIyL0WZQHT/SuarWxrgnSbOD6WVhzORZngyCcjaWAjtWB2LWwoIJbQSoGUCwtor gk/SesrzjsnxiyIYkscdMm83QX1O/xADvUJdOBnTL9/8aXp4lIT5aIcz6wr7ZWuJsscV fnIYbY9quG+KdQw5ApUCVvPLQ96IfuMFrhot+ziDqNUtZVhGl5rrqT8sQbqFz6yzznUK bqEgpgjMx+nOFWdUIOwPQ12FTyXTQvHfBqhVUHTIGbsXQclum0jd7sqNv9ZUgi7sfzFQ Soeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796372403; x=1796977203; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NziZmdpOMD8l0d2yGCnII08SrWmuy7lrep13r52Ww9A=; b=py6Ekv8d2pme1el8hKkdcYMaz9/8j3ktRl5IkW1K/zZ31xpeIpFsCatVOvGl0Y0Prm JvmGm4MFOlNs5OpLyLveutJrfH+aEzTWhHAXBpnd2bbbWMNdI7hlL274EUzb2OoJcx67 PC5CHbZNtkGuf7us2hgJX2Ef3wEb1lChTQILQFP/T9OqAkVrWbWufleTuI9cjVY4xZmA O6GHqHDBnVqvp3vbOp4Y2y7XCmoF/rnDxDJuHOvTySS8lhfdmJVCiXXvNUPH53NbhmpN hdMrW9nAciqzzR2ij8oUzXA6y9CoeWBmirBB7MusqwpqzYSpu48kf2H+xPs4MDblCas5 aEbg== X-Gm-Message-State: APuU4Z/xz7ypS0M86gBsAGT/LLE+ahj97Xb2hA8aymSOc5erZ7A/rwjs Byrq7Y0B1kqa2xPN6Vob3j/zMnAfbVov6f/t0wRCi9WRetebbro446C7bB1VuK2u0Bk= X-Gm-Gg: AZFdTZejE1UOJoa/E8cZJpAZXnKBuIg6hvTzQYIMbBfKD4jBjqHONm26bqn5CTQ6FJL 9CwwSjJKTt82Au1HQQlT3kP4lp9tjkJ7v8FmPR2EMjOPprh2g/Es29Sg74lpGrnALYizswRZ2Ko yloRVD39aCO8Jictv61Eit/ZisFthWu+Hm8Co5bipGaU+VTAHuXe5syubELnW9IPAI/LKOYV5gZ LSOA2WiKSE/6LYEleZ4CXzibEfN3kobEKiavHtvZusaPKcPNPTciW3usZMNbIS58+dXMrtEhMqP MNqwiUnAwpXd5ItNO0yO/gyYXRAhOAXdEs+mH5MH2rPBRDPdshQQPwezJg/NTo9tcjHfkO6oxrD GFOynSfR7lpquYBthmrCApsYHJ7uW/7kWmpsRdSWw07Gwot8LhGOtVRYXwzcV8js0eWpQNPy0QA iGtZ41vsiMMcZnkcqaRGYKu3rVwTUMC4Vf9JZpDLUpPrXFoSOIVcQ0jPp0tQ2jsdVjXqpiUotjJ DHvRdJ2S+SEL01WDHBknquT/tfsilQ6mjRc2br703DoM2ugclcDQwGxEkJw8rnQ5N9xY/eevR6y 7SQ64DOopfR1DUatcwuaK63ZxNQimiBwppMU97lb8g== X-Received: by 2002:a05:600c:4746:b0:4bb:d24b:91da with SMTP id 5b1f17b1804b1-4bbeb8f8a2emr21664525e9.33.1796372403051; Fri, 04 Dec 2026 00:20:03 -0800 (PST) Received: from localhost (109-81-27-207.rct.o2.cz. [109.81.27.207]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe00792dasm137170125e9.5.2026.12.04.00.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 00:20:02 -0800 (PST) Date: Fri, 4 Dec 2026 09:20:01 +0100 From: Michal Hocko To: "Liam R. Howlett" Cc: sashiko-reviews@lists.linux.dev, David Hildenbrand , Andrew Morton , "Lorenzo Stoakes (ARM)" , David Rientjes , Ben Gardon , Johannes Weiner , linux-mm@kvack.org, Chris Mason Subject: Re: [PATCH v2] mm, oom: add rcu_barrier before hiding victim from the oom killer Message-ID: References: <20261202095450.296675-10-mhocko@kernel.org> <20261202212147.379270-1-mhocko@kernel.org> <2opad4tkrq4pwriih5gld6elvqmi3o26zdptgxhj24gvhd7lrl@3k2lrcnjhrgj> X-Mailing-List: sashiko-reviews@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2opad4tkrq4pwriih5gld6elvqmi3o26zdptgxhj24gvhd7lrl@3k2lrcnjhrgj> On Thu 03-12-26 23:06:05, Liam R. Howlett wrote: [...] > > diff --git a/mm/mmap.c b/mm/mmap.c > > index 0b19c720473a..eeb39eaeb23a 100644 > > --- a/mm/mmap.c > > +++ b/mm/mmap.c > > @@ -1330,10 +1330,9 @@ void exit_mmap(struct mm_struct *mm) > > * Free the memory before marking MMF_OOM_SKIP so a re-triggered OOM > > * killer will only skip this mm if it's already freed all it can. > > */ > > - if (mm_is_oom_victim(mm)) { > > + if (mm_is_oom_victim(mm)) > > rcu_barrier(); > > - mm_flags_set(MMF_OOM_SKIP, mm); > > - } > > + mm_flags_set(MMF_OOM_SKIP, mm); > > Since we don't set the MMF_OOM_SKIP first, doesn't that mean the reaper > may continuously find this mm to try-lock, then fail while the > rcu_barrier() is running with the mmap_write_lock() and rcu's > barrier_mutex? Yes it can but keep in mind that the main point of moving MMF_OOM_SKIP is to delay the next oom victim selection. So this is a desirable behavior. Even if the reaper wins the race manages to set MMF_OOM_SKIP on its own then we are not worse than before. -- Michal Hocko SUSE Labs