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.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 57455C433E0 for ; Thu, 23 Jul 2020 20:03:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1AC12206F4 for ; Thu, 23 Jul 2020 20:03:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ZLwjkmdd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AC12206F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 851D66B0008; Thu, 23 Jul 2020 16:03:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B3126B000A; Thu, 23 Jul 2020 16:03:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 654576B000C; Thu, 23 Jul 2020 16:03:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 489BD6B0008 for ; Thu, 23 Jul 2020 16:03:49 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DD8FD11216 for ; Thu, 23 Jul 2020 20:03:48 +0000 (UTC) X-FDA: 77070416136.07.jeans23_570a76926f41 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id ACE261803F9A9 for ; Thu, 23 Jul 2020 20:03:48 +0000 (UTC) X-HE-Tag: jeans23_570a76926f41 X-Filterd-Recvd-Size: 4738 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Jul 2020 20:03:48 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id f5so7660407ljj.10 for ; Thu, 23 Jul 2020 13:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+vKnE7X4C3wzlK1JmSQfpytc1qItyht9kBX7kY+JZA0=; b=ZLwjkmddpJA5gf+HFdEmyLuDA7FQoYg9/jBFMulzEGqemvdcyzVhn6a4S43qPXhK+B t2+creQzWutMv4/M6OVkN7gpfUThbgXramMeuQkhE1v8KmypWYrR+tQpapZoe2l990bU NljuVBzFgz0gYAF8I3r9xVn5s65q9Y70lC2JQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+vKnE7X4C3wzlK1JmSQfpytc1qItyht9kBX7kY+JZA0=; b=sBiVUuCeMZerGKn+OZwv+glq9maBMSFInToeh+4Aw2KpbYiw15792zzecoaVAa4X0w U6BeSYNFGVNNq6TZq//q+gL3NYH8EmA3NNk/HtRc4AKjsYlcvmb5aOkpdT8h4VLBKhYg PDo/WcJOZGJCyDFw59Jp8f35A7Upm074tPp0kX77n1WkbhrM0BEHvwzZ49BLWYl7/HDI nQudpEdsnsphGrVEgYaYB4jHnLDqCuSMkjy0aUf2gxqIFbUn0cRqbpQpI4avOnYYGeq+ j2WUOkETNyMe65yxmk9egoQ2gC9taPxslj7bQIc1QFcAKKdB2oeiSa9hv2a9e67qHWjU 0k9w== X-Gm-Message-State: AOAM530ktTWS5l1vpyT9vs73rv66n0iBnrTqYcQNtdVqjF14vibiOUnL haqrPx74CksUyQT2M4zXww9Xczc3nSk= X-Google-Smtp-Source: ABdhPJzm5AMZOocEdUHBJIMgiCpq/OrzQp61wZKP+TNhStJrv2ZZPEvXWm2LiKiFsOHPjQ0rrWI/zw== X-Received: by 2002:a05:651c:111:: with SMTP id a17mr2895575ljb.265.1595534626170; Thu, 23 Jul 2020 13:03:46 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id 190sm3102088ljf.38.2020.07.23.13.03.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jul 2020 13:03:45 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id j21so3953138lfe.6 for ; Thu, 23 Jul 2020 13:03:44 -0700 (PDT) X-Received: by 2002:ac2:521a:: with SMTP id a26mr3026142lfl.192.1595534624105; Thu, 23 Jul 2020 13:03:44 -0700 (PDT) MIME-Version: 1.0 References: <20200721063258.17140-1-mhocko@kernel.org> <20200723124749.GA7428@redhat.com> In-Reply-To: From: Linus Torvalds Date: Thu, 23 Jul 2020 13:03:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH] mm: silence soft lockups from unlock_page To: Oleg Nesterov Cc: Hugh Dickins , Michal Hocko , Linux-MM , LKML , Andrew Morton , Tim Chen , Michal Hocko Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: ACE261803F9A9 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 Thu, Jul 23, 2020 at 10:32 AM Linus Torvalds wrote: > > So here's a v2, now as a "real" commit with a commit message and everything. Oh, except it's broken. Switching from the "am I still on the list" logic to the "WQ_FLAG_WOKEN is set if woken" logic was all well and good, but I missed the case where we did that trylock_page_bit_common(). It used to just not add the thing to the list if it would get the page bit, and then the rest of the waiting logic looked at that and was happy. But now if it needs to actually fake that WQ_FLAG_WOKEN flag. So that patch needs to do something like this: if (!trylock_page_bit_common(page, bit_nr, behavior)) __add_wait_queue_entry_tail(q, wait); else wait->flags |= WQ_FLAG_WOKEN; in there. Or maybe have that bit set originally, and clear it when we add to the wait queue. I'll send a new version after I actually test it. Linus