Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2404821pxp; Mon, 21 Mar 2022 19:20:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAC7bGHne0045FgK1KppS/MFVLrb7VmTfncCpEX4+M58tECeuA7DEyV2h5vUKZr6cteSX4 X-Received: by 2002:a17:902:e882:b0:154:445d:9818 with SMTP id w2-20020a170902e88200b00154445d9818mr11328834plg.40.1647915649993; Mon, 21 Mar 2022 19:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647915649; cv=none; d=google.com; s=arc-20160816; b=j8g2yWQHoauXZyhScANXPzVwoqnxKEJcL1J7zX7lVVQfGzO3THViSpbE1o0hzQx7/4 E7cnfvtumKsQgGzXAiWpKWhk4zyEq8jkfMgjX2yKOWnbN5i/tek8NfhwG9N4zCQ3vKqx syJ/n2uMe7/wLRXCx5LDAb3ELIkYt34Ugq1jli9TEB3cC5XWS46+P9Zza+4uGvsCKe7Y mfR+kWxASfjzPVf+rxYhGLMsKSBeP00i8FsCYbibGqz8C8nLyMnXpIqYbrro2zq0NGua Ky0huGVrTFhJP8NZOleY/nv7fwztE4nTtLQ/lOcFC7EV6XMjYC1RBkG7bGU1bXuqrS3+ /dNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:cc:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=uFNsqpDgHlwcJWc3v3norTXsqUprQGWM/kHX+J5t3Ig=; b=TQTWAsrEEWlnc0FEKaoPb63BfGvOnUxVzEhgAuJwIS3Coo1gQoCGvz+r7I/v5oXJUq rL4gSv1GhLZC/D4oBfR0VzQGR4ABvwFw810/nq+YNF0cv0QhNMi9DHF9wj/oPQxChEqd aXkBzyUErDX07mGxXXg7lGnoSyiQrTbh5h4BtY/BZp7aNXJ26GHiLwG83Rh6AJx0XQJX z56CI9SobU/jUH2Rmi9oR1PfG4EUGK9daEoXcWefdv8ZhqSmLuaoSVOkfvr5062/H2MZ 1oEA/IoXTLwWuSERwWC1eVh82WTg3AvVRiRJkZN7VQfPCkHHOEJldmdqkxbrfgPX+1bU Tm5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CU4rrbrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ls2-20020a17090b350200b001bd14e01fb0si945145pjb.158.2022.03.21.19.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 19:20:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CU4rrbrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A80ED41609; Mon, 21 Mar 2022 18:53:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235139AbiCVBzE (ORCPT + 99 others); Mon, 21 Mar 2022 21:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235114AbiCVBzC (ORCPT ); Mon, 21 Mar 2022 21:55:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C81D638182 for ; Mon, 21 Mar 2022 18:53:35 -0700 (PDT) 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-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-434-6Bd3W-KdPhaqKInQzmq6Ag-1; Mon, 21 Mar 2022 21:53:33 -0400 X-MC-Unique: 6Bd3W-KdPhaqKInQzmq6Ag-1 Received: by mail-il1-f199.google.com with SMTP id t16-20020a056e02061000b002c7ddaa0006so7174019ils.7 for ; Mon, 21 Mar 2022 18:53:33 -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=o1eCtlWbMXHcHIfBFOvwo9CUwerWs8/65rQkF/HhlfTi6FoDXzCSMpnCGPCq078g51 FKHTb/lv2tnaEyqP9JwwceHa6X9uvxHfEkST3sF4K6brD5n/1rcD7NkSfNmeywKmDhaf 0e+NTVAtjThHW72Zdeax3ZaDzoul6IKLaLy4v6S/4ZaaTrExLRKibORkDNXw/abzoRYh eYIt9cTTN12wPkvhLJy06L1Raa8sf4b7gDvFLW1kXjfsO1ujceAL3T8cw5KQqalBYjyl TAhyJ9mMbjpB10fCL+3yuvpGMoTjNlp8XYEjmzU6G53jLxrCVDfjncf/DpgXQpUweWqp 6Ytw== X-Gm-Message-State: AOAM531kAS/RlJhw5ZVJ9vESAgylSCqZXq8irWhMknl5WSAwUDiEG8MM VGb+43O/nhVCtRiCs7T38uzjhgp3bBZ5yfvLZvuwIu6JTPp81zcjMbr2cuKyiq2hBUlaiVIkeP7 /Sz+2Lwk8ve+FsSHQwHQfKPWh X-Received: by 2002:a02:862a:0:b0:319:dc78:e4c0 with SMTP id e39-20020a02862a000000b00319dc78e4c0mr12827505jai.43.1647914012396; Mon, 21 Mar 2022 18:53:32 -0700 (PDT) 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 Content-Language: en-US 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >