Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1137477ybh; Thu, 23 Jul 2020 01:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPldZvjdoBe9ZpISMteqM80IFuw+RQ27jVb0UG3JfovV5g0P2yRPM9IbZNRggHOnoQKJbn X-Received: by 2002:a17:907:7291:: with SMTP id dt17mr3150667ejc.73.1595491492835; Thu, 23 Jul 2020 01:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595491492; cv=none; d=google.com; s=arc-20160816; b=AyT1vrZVN+OrcdPy0dHZt3oVT/vGHFD/7tzi7R7Cf/L7ueO155SQgPrHe/ytNDEULo toUjoQaQVqBMc3BpNM7k0pIPAnSnb6lOcWJqwnQK0NV8XjfIoERdCFeyeYny2mGcxVhy l8eJtArsJ7Oe9Kes365iyKch+a/7iLyHBssQx83L3A+4ulKzbbAF2nCri/bEUXPKy46c 2UMpPehyLUkAyt49j9/jiO0cAjR5Gu6e/6HX0m3vLWF2aTb5kGq/ppvPbPz78OFgp+RT B50vReVaxqJx3nNIKZYXISz7LCzz6YClZQT5ZfI6lQ1pcDjkAvfJJD6cfRq0xbLuRuRy iaYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=bCs96AWK1IeU0Pi3Hq8GZsVghkdCcCGSOQ2rhkm1nLw=; b=knBWBSgff3iMJ2S+2JaJW7z96qLj/DldwhR10TndIkL4EYW7X3Ty4msHCOhvwehTo2 wH9/IndVEcqd5nMnva21TOi1VRRyK/GNQxAC4ErzjQINGQzE83pTkUi9DRQop0fJuPpE y4KpXGJ5Zv96UDEHDovcAjXpwuY85T/aXXQ6WLypnpTD7FIsHIBSSCxWDFtp6wkg7VU7 PusNVG89pwMYcFyMllTvFPTqjpOPdYHXfES3pRLXxKS5Iiwl+tKaD3qguNVnTwDV2HsP mWYPiajTNYR/qHEMMgN7rL5gtYcE1yR1DLqnz7ga8d439E67DpmAbTmu5fGzbyzsJmeQ fSWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gw16si1411439ejb.274.2020.07.23.01.04.29; Thu, 23 Jul 2020 01:04:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726500AbgGWID7 (ORCPT + 99 others); Thu, 23 Jul 2020 04:03:59 -0400 Received: from mail-ej1-f68.google.com ([209.85.218.68]:36022 "EHLO mail-ej1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbgGWID6 (ORCPT ); Thu, 23 Jul 2020 04:03:58 -0400 Received: by mail-ej1-f68.google.com with SMTP id n22so5393522ejy.3 for ; Thu, 23 Jul 2020 01:03:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bCs96AWK1IeU0Pi3Hq8GZsVghkdCcCGSOQ2rhkm1nLw=; b=Zd3S9stGPv98alFSxwWaDX2afqxn4cc36JJhoQl7V9am/mcdUrdGFkIctUnCzxFktr XgJxrT4lK26OMG7L+IuUw34aYDSMdlL8q7QJPv1cosXECSx7kaiOvQEJC1tUN3b+VJHV 0ITI0NHmtnvQ8xpZTglF7nNo/+LYTgrkugvcoVhggd/lAv83iod9C09PkfvbiijtmzVs GYH6SPuQue2lSShRilm/AyoEcZCCFBq+VooARVbcwd6LqJPPwTUYDS6tTksSU7NJbKcg xwzGFhEh3PvZlYGHcZcXy3Cv4dYDNVrMXc/mwn5/N92L7Twt8tVyHQN2coXZYfSyXTCl 03VA== X-Gm-Message-State: AOAM530nQeE7x/W8toNHhJn6kwaEMybj76LzT5vl40ngonwvssmoZlfI YEq+9G991ml127f09fJVV1OBEICL X-Received: by 2002:a17:906:23e9:: with SMTP id j9mr3149698ejg.107.1595491436925; Thu, 23 Jul 2020 01:03:56 -0700 (PDT) Received: from localhost (ip-37-188-169-187.eurotel.cz. [37.188.169.187]) by smtp.gmail.com with ESMTPSA id c10sm1614880edt.22.2020.07.23.01.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 01:03:56 -0700 (PDT) Date: Thu, 23 Jul 2020 10:03:49 +0200 From: Michal Hocko To: Linus Torvalds Cc: Linux-MM , LKML , Andrew Morton , Tim Chen Subject: Re: [RFC PATCH] mm: silence soft lockups from unlock_page Message-ID: <20200723080349.GY4061@dhcp22.suse.cz> References: <20200721063258.17140-1-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 22-07-20 11:29:20, Linus Torvalds wrote: > On Tue, Jul 21, 2020 at 8:33 AM Linus Torvalds > wrote: > > > > More likely, it's actually *caused* by that commit 11a19c7b099f, and > > what might be happening is that other CPU's are just adding new > > waiters to the list *while* we're waking things up, because somebody > > else already got the page lock again. > > > > Humor me.. Does something like this work instead? > > I went back and looked at this, because it bothered me. Thanks for pursuing this. I have learned that the affected system is in fact a production machine which doesn't seem to have any downtime window planned soon. Moreover the issue is not always reproducible. So I cannot guarantee I can have this or other patches tested soon which is really unfortunate. > And I'm no longer convinced it can possibly make a difference. > > Why? > > Because __wake_up_locked_key_bookmark() just calls __wake_up_common(), > and that one checks the return value of the wakeup function: > > ret = curr->func(curr, mode, wake_flags, key); > if (ret < 0) > break; > > and will not add the bookmark back to the list if this triggers. > > And the wakeup function does that same "stop walking" thing: > > if (test_bit(key->bit_nr, &key->page->flags)) > return -1; > > So if somebody else took the page lock, I think we should already have > stopped walking the list. Right! I didn't bother to look at the wakeup callback so have missed this. For completeness this behavior is there since 3510ca20ece01 which we have in our 4.12 based kernel as well. -- Michal Hocko SUSE Labs