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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35AC6C433E0 for ; Thu, 23 Jul 2020 08:04:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EBD8220658 for ; Thu, 23 Jul 2020 08:03:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBD8220658 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 73BC76B0005; Thu, 23 Jul 2020 04:03:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6ED076B0006; Thu, 23 Jul 2020 04:03:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 601AD6B0007; Thu, 23 Jul 2020 04:03:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 4C9DC6B0005 for ; Thu, 23 Jul 2020 04:03:59 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E0ED118019F3E for ; Thu, 23 Jul 2020 08:03:58 +0000 (UTC) X-FDA: 77068602156.15.fang42_2d1375826f3d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 925C0184A770E for ; Thu, 23 Jul 2020 08:03:58 +0000 (UTC) X-HE-Tag: fang42_2d1375826f3d X-Filterd-Recvd-Size: 4221 Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jul 2020 08:03:58 +0000 (UTC) Received: by mail-ej1-f65.google.com with SMTP id o18so5368940eje.7 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=l7RCQgNkujRUZiU7AasiFySUvdJQ4lg/WwjNc31sW7wFHo7vmS+VKAaJ/3gKVftVly uEEqs48HG2wKGPlhYSi6LaW9vP7PDTB7bISnM2sHytqtnYooXDsAl81A87dVHBDJihAQ n7TGt/nn+198a3bRi6QcsVINrkk4Y1+eC7t9zpat8LXlZLCTsBXz/59XHiyz+/ZCfZId jG4M8vz29cIecMj2CTVvdl3APuxWNCRM+thQwVJ2u9QXhQaUANXEA4hbM6+V6a7WMYil FhTMN6KlF2yxkmYh7rkgj4Lzs1SdwL9FaqFAV1kyVXtDS4FYkIcil7kS2NnTRrN5+EBy lZgQ== X-Gm-Message-State: AOAM531LbdnMDURZfpld3p8sRNLXqiHR4FTNMnI2aaytWOo0WjNXzTK6 AX9PwYIQGKhDYBAwakVE4DE= X-Google-Smtp-Source: ABdhPJww8PpEwt4eaNKqvIT/UpfaPHSYqjku44Ho1ALUwDJfuJ4+Nj7wApmHlOWdFK8LDxXeNY9MYg== 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: X-Rspamd-Queue-Id: 925C0184A770E X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 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