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 2E622C433EF for ; Fri, 8 Apr 2022 08:52:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A95458D0001; Fri, 8 Apr 2022 04:52:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F78F6B0075; Fri, 8 Apr 2022 04:52:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FD068D0001; Fri, 8 Apr 2022 04:52:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 69D586B0074 for ; Fri, 8 Apr 2022 04:52:38 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 12DACAB9AE for ; Fri, 8 Apr 2022 08:52:38 +0000 (UTC) X-FDA: 79333095996.30.C1E857E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf13.hostedemail.com (Postfix) with ESMTP id B1F5A20007 for ; Fri, 8 Apr 2022 08:52:37 +0000 (UTC) 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-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-nhYzpuOQNPSpxoGjHfoFZQ-1; Fri, 08 Apr 2022 04:52:36 -0400 X-MC-Unique: nhYzpuOQNPSpxoGjHfoFZQ-1 Received: by mail-qv1-f72.google.com with SMTP id jt1-20020a05621427e100b004442a992b37so97578qvb.0 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=lGgDp4OesmpLvD46UjiXstSycHND1Yx4548YLPS3hqTvxaPEv3yWaW4C+CvbPVeF1Y iRPamwrxeamadXJL1Z7EoWyHA+zFqwfPrieWSVtFWA7xowixYTEjT30at7ZNuwnWn77m 1GFurvykYRnzFgIriZ5M0UbdO13dgLp8ks/griYisaLis7tCkWxyNi20Rb7uki3gHk0K GZPESyj5anrHsVRLOBUpVW8Nsy8NVxaW6YgeMMkXwrWXeTQcci+k7iuvZ7Rtnf/jjCEV 6Y+MsQUXw4V9kRMyGFaUPOtJyqUG7pya5rgn0kRR2nhjZUxMC5dfSEUpm0ZLb92P0vgV Fraw== X-Gm-Message-State: AOAM532juo20SAcalr3H6aoa3iopqb0IbwAraQNnUtPNG4NFtcxtYeWW tHjo4fhGXDTJ+VtiZjg9Sun/6Z5wN2xnsA64hjXbJwg5Sn/ujdxQWgaLkHzE+fjyCoCtVVIqfle HOof+T4yICoM= X-Received: by 2002:a05:620a:448c:b0:67d:4fe3:2b96 with SMTP id x12-20020a05620a448c00b0067d4fe32b96mr11708032qkp.663.1649407955547; Fri, 08 Apr 2022 01:52:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8e28K12WSI03L5GoUoGhDpAl4ilNcJhqTbHLHggp321X66c1rTEnZqPBv7L5AjbrIhSphvw== 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 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> 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: aayx9crcmz7bko1pk1az3ny6ejqzq454 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: B1F5A20007 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=a1KYxseH; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf13.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=npache@redhat.com X-Rspam-User: X-HE-Tag: 1649407957-661945 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 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 > >