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 BCFB3C433EF for ; Mon, 11 Apr 2022 06:48:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1957E6B0072; Mon, 11 Apr 2022 02:48:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 145616B0073; Mon, 11 Apr 2022 02:48:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F029C6B0074; Mon, 11 Apr 2022 02:48:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id E0E956B0072 for ; Mon, 11 Apr 2022 02:48:48 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A136E23616 for ; Mon, 11 Apr 2022 06:48:48 +0000 (UTC) X-FDA: 79343670336.05.3718F54 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf09.hostedemail.com (Postfix) with ESMTP id 1DF50140002 for ; Mon, 11 Apr 2022 06:48:47 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id AD80A1F388; Mon, 11 Apr 2022 06:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649659726; 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=Q6Qt/7zIphtgdljo33ozWKYZbX8UCtN64PZbxI4ynqw=; b=vWvVnerv/tjfxZAbDG7/Zv0b0LO+/8VrLmtaLRBB8lyuUhhsc2YBPSNDMLSyIg9Kf1P0hn pJv15RXG45PZEKGst8+awsZmMyCxeR4+AxRAIGNzGe1Kaa50KAqNRM/DZfyueIjN8Tmr34 IaCOQBI01Q5L6EZG60GGKCjRarPHU1s= 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 1BDC2A3B83; Mon, 11 Apr 2022 06:48:44 +0000 (UTC) Date: Mon, 11 Apr 2022 08:48:38 +0200 From: Michal Hocko To: Thomas Gleixner Cc: Joel Savitz , Nico Pache , Peter Zijlstra , linux-mm@kvack.org, linux-kernel , Rafael Aquini , Waiman Long , Baoquan He , Christoph von Recklinghausen , Don Dutile , "Herton R . Krzesinski" , David Rientjes , Andrea Arcangeli , Andrew Morton , Davidlohr Bueso , Ingo Molnar , Darren Hart , stable@kernel.org Subject: Re: [PATCH v8] oom_kill.c: futex: Don't OOM reap the VMA containing the robust_list_head Message-ID: References: <20220408032809.3696798-1-npache@redhat.com> <20220408081549.GM2731@worktop.programming.kicks-ass.net> <87k0bzk7e5.ffs@tglx> <87sfqni77s.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sfqni77s.ffs@tglx> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1DF50140002 X-Stat-Signature: 3gwbkyaz4es91cestsaxrb3hj4hc8nsb Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=vWvVnerv; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf09.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspam-User: X-HE-Tag: 1649659727-551942 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 Fri 08-04-22 23:41:11, Thomas Gleixner wrote: [...] > Coming back to your original question. > > What's the difference between a process shared and a process private > futex in the context of a multi threaded process? > > - The process shared must obviously have a shared mapping > > - The process private has no need for a shared mapping because > all threads share the same address space. > > What do they have in common? > > - All of them are threads in the kernel POV > > - All of them care about the unexpected exit/death of some other > thread vs. locking > > So why would a process private robust mutex be any different from a > process shared one? Purely from the OOM POV they are slightly different because the OOM killer always kills all threads which share the mm with the selected victim (with an exception of the global init - see __oom_kill_process). Note that this is including those threads which are not sharing signals handling. So clobbering private locks shouldn't be observable to an alive thread unless I am missing something. On the other hand I do agree that delayed oom_reaper execution is a reasonable workaround and the most simplistic one. If I understand your example code then we would need to evaluate the whole robust list and that is simply not feasible because that would require a #PF in general case. HTH -- Michal Hocko SUSE Labs