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 07B7CC433F5 for ; Tue, 22 Mar 2022 01:53:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84AEE6B0072; Mon, 21 Mar 2022 21:53:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F9706B0073; Mon, 21 Mar 2022 21:53:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69A936B0074; Mon, 21 Mar 2022 21:53:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 56C946B0072 for ; Mon, 21 Mar 2022 21:53:35 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F3A848249980 for ; Tue, 22 Mar 2022 01:53:34 +0000 (UTC) X-FDA: 79270350348.25.2DC1CBD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 8561DC001E for ; Tue, 22 Mar 2022 01:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647914014; 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=uFNsqpDgHlwcJWc3v3norTXsqUprQGWM/kHX+J5t3Ig=; b=CU4rrbrhdqNXGnIrPTPsCesSzSt7HCOk8SABmV+D1BU+y3sT0CNbXObs5QdIrg9dUighwg +iPh2J+cziu2K+av0IoStpWz+HIpL3IleChN51pTrgIwzacK3bJHbXaq/DaD/cXIfNa+jZ cGRu6cdUuSQ5CZEoZjabNoglFCccEcI= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-AC3M-geGPWqdUoRdXIoMXg-1; Mon, 21 Mar 2022 21:53:33 -0400 X-MC-Unique: AC3M-geGPWqdUoRdXIoMXg-1 Received: by mail-io1-f69.google.com with SMTP id z16-20020a05660217d000b006461c7cbee3so11548685iox.21 for ; Mon, 21 Mar 2022 18:53:32 -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=uFNsqpDgHlwcJWc3v3norTXsqUprQGWM/kHX+J5t3Ig=; b=Jpjt0oVHJDGSb+N0weijiTwsHwcdppJ8R60Sh5rYsDukTE2ZMo13AjFClFK4umJWK7 O1pTBASgi17azG/rn0z3wBa7sFVv4EAtcM17L96BrIkgkpv9WiS0CIIwloITNKahO+0e GEbviq6Ze9ayfwqKx7WAWSN6VqRkE8nIxlWnYES7DBnxnPdGdEKJDQtHNnJz4hW/hdVC CZafigsqeLYwzOII8IWUMAbFMIZpWzCMOpgJOVRfyhPuFDglEb8AQZcDYAWybmsvhS+K as5ObemXWXLvCOUNynidpEn+72fg38H14Dr7N15i51SFeqSoLi+aXbE8PYPhuDWR9POF ytjA== X-Gm-Message-State: AOAM533db0B7E4VyIGSn2e2tngJgU2vm4StdbqP5l748Cw0d0nIskvH9 w93w+4Yqy7W9Yj01p3mzEvFEFXLFPQ1qJA/D9E6cQJDjqcO1GJVn2rlo6TlCt7WCDmeVuoctV0x 4xXud43qmf3U= X-Received: by 2002:a02:862a:0:b0:319:dc78:e4c0 with SMTP id e39-20020a02862a000000b00319dc78e4c0mr12827513jai.43.1647914012398; Mon, 21 Mar 2022 18:53:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8bte1WXFTU8OUCyGzAx1f7rsxslZ1ODKlNKZMhc1jWXF7e+o9XaEshaQnbT2hydNoyTxl/Q== X-Received: by 2002:a02:862a:0:b0:319:dc78:e4c0 with SMTP id e39-20020a02862a000000b00319dc78e4c0mr12827493jai.43.1647914012199; Mon, 21 Mar 2022 18:53:32 -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 h4-20020a5e9744000000b006415b179a0dsm9157661ioq.37.2022.03.21.18.53.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Mar 2022 18:53:31 -0700 (PDT) Message-ID: Date: Mon, 21 Mar 2022 19:53:29 -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> 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: <20220322004231.rwmnbjpq4ms6fnbi@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-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CU4rrbrh; spf=none (imf28.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8561DC001E X-Stat-Signature: dioh6ychtsnwo4wr43nqn4kuu9tzmzgx X-HE-Tag: 1647914014-780885 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 18:42, Davidlohr Bueso wrote: > On Mon, 21 Mar 2022, Michal Hocko wrote: > >> The more I am thinking about this the more I am getting convinced that >> we should rather approach this differently and skip over vmas which can >> be holding the list. Have you considered this option? > > While I tend to agree with this over a hacky trylock approach, I cannot > help but think that v3 was the right thing to do, at least conceptually. Yeah conceptually the V3 was the first correct patch. It could use some slight cleanup with a wrapper like in this v5 (has_robust_list), and instead of returning it should set MMF_OOM_SKIP. > Robust futex users here care enough about dealing with crashes while holding > a lock that they sacrifice the performance of regular futexes. So the OOM > killer should not cause this very thing. I went through previous threads > but other than the user base (which I don't think would be very large > just because of the performance implications), was there any other reason > to no just set MMF_OOM_SKIP upon a robust list? 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. If we can't find a good/reliable way to check if the vma contains the robust list then I think we should just skip the OOM like in the v3. Cheers, -- Nico > > Thanks, > Davidlohr >