Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp106070pxw; Fri, 8 Apr 2022 02:28:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxku6UrJaMiBcD1S7gHV8RLVMN09QjsI89RdKnStpDRPe1iDc2Se+L0FyL7JQfIE3WWgnLJ X-Received: by 2002:a50:ec0f:0:b0:41d:10c1:3d03 with SMTP id g15-20020a50ec0f000000b0041d10c13d03mr5819149edr.17.1649410113772; Fri, 08 Apr 2022 02:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649410113; cv=none; d=google.com; s=arc-20160816; b=ubyXXSGPyH4+at2Ln5epJ8LEOyUmRUd+0xvRxhIF4chQ2bLA+emc8n18x4c2x0Ji9g rB54swUiAabWni/2qC+8riWb9/ZL6lqWjn5kRhpYv6QW9N//mSPRprDwv1aM/ZgKzfeT GcdkXcV8Co27BOHZb3g7XR8rYGZLt7yqZgPUpwj/hJbe0GRJxeQCrvahj2qk06m9Gcqo ASxPdU3iaHcsYuORd90wz6gMSdRpOu67+ED8Fl4JMZI0Tc2xY9z36a+mztYn6cnFa4/Z 5btbk/Hq7qxQcnwXWhw/b0zaMSQLQlSEKVQgV2sZtiEtVw7vWf9dIVaTQSDMvfPa+Wui AtsQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=G7/YImBklsA+ohVD5C9vqSQwoQu6qVBBXj3k65Td9/M=; b=AnePZbPgt0FQeZk0cjp/ahExeQ3pKiJPDIJ6m93EpJ1gDMr03nQEIc6SWWVAdf3a8d A0Ujw0Qs2isJISx905HAkZ3F+8pQqURXhxqEZFGFCVfhNXjgRibQNMjvrKiDLHNJht4/ EY5nZ60IPNN3wB9/SVklkNPOp9KhBwIjdvwTaTKsPDuzUc2gEGKoHkPR5Hi0qD6Nik4J 4/9Qgh+GCpwCQM6K9f8xFNfBYrLGVGMq5dontRm+ZV+J5MZ73JGdDW3xnqogNul68lxQ jRR+rhLKhCSsARLhsO/A0xO8k2jS0idzMBY3sitxOrVQyR8xKjoSwLD9OPv79bJAM420 wI6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a1KYxseH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a05640242d200b0041cdd61979asi544567edc.615.2022.04.08.02.28.08; Fri, 08 Apr 2022 02:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a1KYxseH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232417AbiDHIyo (ORCPT + 99 others); Fri, 8 Apr 2022 04:54:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbiDHIyl (ORCPT ); Fri, 8 Apr 2022 04:54:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12FCB38D8B for ; Fri, 8 Apr 2022 01:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649407957; 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=G7/YImBklsA+ohVD5C9vqSQwoQu6qVBBXj3k65Td9/M=; b=a1KYxseHkelx9ZEAxDv4y8TOXV2Ri81qDvbQ4tsaV8OFNtgD0FWSKXS8sQc1g3/o4ibJJY kRi7BWgJWO4CCRvm4XHNQpwZ8ghSlD4xrgS5XbSAd7dX0uMfG1kL9E6QyXfGUTZwdst4vX fawn/Pl2BMYl34BwqNbdLyBaD73TRdw= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-rf5nLTMtMGGYNrGBHEy47g-1; Fri, 08 Apr 2022 04:52:36 -0400 X-MC-Unique: rf5nLTMtMGGYNrGBHEy47g-1 Received: by mail-qv1-f71.google.com with SMTP id o6-20020ad45c86000000b00443e7ec6026so8829334qvh.19 for ; Fri, 08 Apr 2022 01:52:36 -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:cc:references:from:in-reply-to :content-transfer-encoding; bh=G7/YImBklsA+ohVD5C9vqSQwoQu6qVBBXj3k65Td9/M=; b=FWjRnu51wZhdy3CCYf4hF/Cq93Sy8V3XnfFmMOh6ZfXdyfMPtO4HOFTXHeksVcKmi2 vVkJMHV8EMt1An/1qQSTKM6eHVgsWO/pMT/Zwat3n1M+XfAxq3K3EpiQVM6EMytBcJDm CjSWTBNcaM8ir/lNqElTx26i0e5wlMku8L5Hu42ZmzL7lxVL03pTGPpe/ID3mVypPyfd Cam7sPouXwfi4zC3d9oboPqYAWxyP2sXCC2xqAhRstywJSm/dZqVcxeIq44c7bq7q1W6 bfGpR6p+s7Iq4z78u29mZqEktyBXD2ZVTzFDF6rdRk0Ot4KymlgKjyTj1Z2k4kaLAUmh JiYg== X-Gm-Message-State: AOAM530b4/PTR0BM4QJnF/ZSGmk7NzVK6sUTLbG7DbSsH1biW6nAD0ru sT+MN0ivmcw1CLPEZrb0ZtcVtvwquNMFQ2w0fDoTDY/vNqOkeMw497UL1EEpB3qOg7I1XeXGdGC tDNTKjOdXKYBoBUUEvuGVDL6+ X-Received: by 2002:a05:620a:448c:b0:67d:4fe3:2b96 with SMTP id x12-20020a05620a448c00b0067d4fe32b96mr11708029qkp.663.1649407955546; Fri, 08 Apr 2022 01:52:35 -0700 (PDT) X-Received: by 2002:a05:620a:448c:b0:67d:4fe3:2b96 with SMTP id x12-20020a05620a448c00b0067d4fe32b96mr11708019qkp.663.1649407955305; Fri, 08 Apr 2022 01:52:35 -0700 (PDT) Received: from [192.168.0.188] ([24.48.139.231]) by smtp.gmail.com with ESMTPSA id az17-20020a05620a171100b00680af0db559sm14053367qkb.127.2022.04.08.01.52.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 01:52:34 -0700 (PDT) Message-ID: Date: Fri, 8 Apr 2022 04:52:33 -0400 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 v8] oom_kill.c: futex: Don't OOM reap the VMA containing the robust_list_head Content-Language: en-US To: Thomas Gleixner , Peter Zijlstra Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Rafael Aquini , Waiman Long , Baoquan He , Christoph von Recklinghausen , Don Dutile , "Herton R . Krzesinski" , David Rientjes , Michal Hocko , Andrea Arcangeli , Andrew Morton , Davidlohr Bueso , Ingo Molnar , Joel Savitz , Darren Hart , stable@kernel.org References: <20220408032809.3696798-1-npache@redhat.com> <20220408081549.GM2731@worktop.programming.kicks-ass.net> <87tub4j7hg.ffs@tglx> From: Nico Pache In-Reply-To: <87tub4j7hg.ffs@tglx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 4/8/22 04:37, Thomas Gleixner wrote: > On Fri, Apr 08 2022 at 10:15, Peter Zijlstra wrote: >> On Thu, Apr 07, 2022 at 11:28:09PM -0400, Nico Pache wrote: >>> Theoretically a failure can still occur if there are locks mapped as >>> PRIVATE|ANON; however, the robust futexes are a best-effort approach. >>> This patch only strengthens that best-effort. >>> >>> The following case can still fail: >>> robust head (skipped) -> private lock (reaped) -> shared lock >>> (skipped) >> >> This is still all sorts of confused.. it's a list head, the entries can >> be in any random other VMA. You must not remove *any* user memory before >> doing the robust thing. Not removing the VMA that contains the head is >> pointless in the extreme. >> >> Did you not read the previous discussion? > > Aside of that we all agreed that giving a oom-killed task time to > cleanup itself instead of brute force cleaning it up immediately, which > is the real problem here. Can we fix that first before adding broken > heuristics? We've tried multiple approaches to reproduce the case you are talking about with no success... Why make a change for something that we cant reproduce when we are sure this works for all the cases we've attempted. I also dont see how this a broken heuristic... If anything adding a delay is broken. How do we assure the delay is long enough for the exit to clean up the futexes? In a heavily contended CPU with high memory pressure the delay may also lead to other processes unnecessarily OOMing. Cheers, -- Nico > > Thanks, > > tglx > >