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 DF664C433EF for ; Tue, 22 Mar 2022 03:09:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 499D16B0072; Mon, 21 Mar 2022 23:09:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 449576B0073; Mon, 21 Mar 2022 23:09:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E9C66B0074; Mon, 21 Mar 2022 23:09:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 1F8E76B0072 for ; Mon, 21 Mar 2022 23:09:52 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CD40E182888CB for ; Tue, 22 Mar 2022 03:09:51 +0000 (UTC) X-FDA: 79270542582.20.B776A27 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 490F420014 for ; Tue, 22 Mar 2022 03:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647918590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DBtHCrAqM8PwKsCvhHfbFfAvk2Wqf5blryM4kHsbRbI=; b=RCGELxqEwIljF5MraCQZv2CXmRQeZ1+FlnFwikdbiji12DEUeK+FaydYuCawZZ4t/7N1RM YJb8qaffkOEalnAwr/f425GMKUjkwHryI+vXrA37kJPqdq5AXd4rl8uLXYUAizjqjeI/Q9 XecRUOz2rnn0rM/lhcxYHlyMLl6MCd4= Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-138-35NIadG0P9ya80_hrsW4oQ-1; Mon, 21 Mar 2022 23:09:49 -0400 X-MC-Unique: 35NIadG0P9ya80_hrsW4oQ-1 Received: by mail-il1-f200.google.com with SMTP id m20-20020a92c534000000b002c83ed01909so869939ili.1 for ; Mon, 21 Mar 2022 20:09:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:cc:in-reply-to :content-transfer-encoding; bh=DBtHCrAqM8PwKsCvhHfbFfAvk2Wqf5blryM4kHsbRbI=; b=BbWNRKaYXk37RWIyIfKNJhudImz8ilo6tFSwU/fSpZEkxPh/tTg98lyO1pyci6Ahn0 V6dLnz/axLWAOrZ32F/PexLsqJC5VoePCv2aCQybGzvd0dWaAFsie+KRiWY+TWNn1jUL qWPP7XwfGgmdZybBeIhcBXM0cY3NtQBpJna9MKYxyJGviq13gH2bzEXYQvODNxtTAf1X oZGXoYr3PntTV3yuQlmVe/zGLcSeKp9S9DAb/9M25UISNEC2xaBv5ogY9M96xZpyytV/ YNitZIg4I2AHmb+Vkapk+8FKEb6K6OLZMs+a6LQIpErL5Ga2oukr1/wEeXh6PK9nfaJV VxXg== X-Gm-Message-State: AOAM531vA/B/7rECzJpntVbZVlmyWYOT87tctlQ4C8tYHMnHCBJ8QKWZ 4nP6Wyn9m6GHZrI5YRlK+ICIUd3IOhZ5+G9QA1tgnFf2JB2RJsWcL9eT+Rt3T+fhB5PxS+CbPAq wsv3/vvgBGqM= X-Received: by 2002:a92:9406:0:b0:2be:6ace:7510 with SMTP id c6-20020a929406000000b002be6ace7510mr10721173ili.291.1647918588742; Mon, 21 Mar 2022 20:09:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvveSDS6+Wk3t25fD33XZkALpAjB2gIMNBsXYlv9C/guBU/azXhcdbQe9c8WLlaAPMh2jOsA== X-Received: by 2002:a92:9406:0:b0:2be:6ace:7510 with SMTP id c6-20020a929406000000b002be6ace7510mr10721153ili.291.1647918588534; Mon, 21 Mar 2022 20:09:48 -0700 (PDT) Received: from ?IPV6:2601:280:4400:a2e0:7336:512c:930d:4f0e? ([2601:280:4400:a2e0:7336:512c:930d:4f0e]) by smtp.gmail.com with ESMTPSA id d14-20020a056602328e00b006494aa126c2sm7889638ioz.11.2022.03.21.20.09.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Mar 2022 20:09:48 -0700 (PDT) Message-ID: <0d0fb94a-ff66-ac31-e126-0eaf4dca0d6a@redhat.com> Date: Mon, 21 Mar 2022 21:09:46 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v5] mm/oom_kill.c: futex: Close a race between do_exit and the oom_reaper To: Michal Hocko , Davidlohr Bueso References: <20220318033621.626006-1-npache@redhat.com> <20220322004231.rwmnbjpq4ms6fnbi@offworld> <20220322025724.j3japdo5qocwgchz@offworld> From: Nico Pache Cc: linux-mm@kvack.org, Andrea Arcangeli , Joel Savitz , Andrew Morton , linux-kernel@vger.kernel.org, Rafael Aquini , Waiman Long , Baoquan He , Christoph von Recklinghausen , Don Dutile , "Herton R . Krzesinski" , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Andre Almeida , David Rientjes In-Reply-To: <20220322025724.j3japdo5qocwgchz@offworld> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: 7xrutd5aepwxbf7qp9xow1p39itph3qz Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=RCGELxqE; spf=none (imf03.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 490F420014 X-HE-Tag: 1647918591-587643 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 3/21/22 20:57, Davidlohr Bueso wrote: > On Mon, 21 Mar 2022, Nico Pache wrote: > >> We could proceed with the V3 approach; however if we are able to find a complete >> solution that keeps both functionalities (Concurrent OOM Reaping & Robust Futex) >> working, I dont see why we wouldnt go for it. > > Because semantically killing the process is, imo, the wrong thing to do. My > performance argument before however is bogus as the overhead of robust futexes > is pretty negligible within the lifetime of a lock. That said, the users still > have good(?) reasons for not wanting the lock holder to crash on them. >From my understanding, the whole point of the robust futex is to allow forward progress in an application in which the lock holder CAN crash/exit/oom. So semantically nothing is wrong with killing the futex holder... the whole point of the robustness is to handle these cases. We just have a case were the oom killer is racing with said handling of the futex, invalidating the memory before the exit path (handle_futex_death) can awake one of the other waiters. -- Nico > > Thanks, > Davidlohr >