Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1601162ybh; Thu, 23 Jul 2020 13:04:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEEbEwGjMccXV9fkjCkJX5/RookJ1Yk6xysvdsHHjIlvGybz3uTOBXsgkWW9n74uNOR5UM X-Received: by 2002:a17:906:b16:: with SMTP id u22mr5896428ejg.53.1595534662128; Thu, 23 Jul 2020 13:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595534662; cv=none; d=google.com; s=arc-20160816; b=JBG/NQHUc8Na3kS4riU1XrqB26GN9jBnL8qW99wKaRlQcTYeM0GxiRI0fO4dU/m3Gt 1W0bzpL8BRrPrnpNZOTkP8wh2n3aBIK7c0raY+LUDAfNJGxdYtxIVv0SQn6ZrTGiPEjJ 0gq4l7rqjy43uBSy5xKdhu+zy3HCt+Xft9i48Q5Awyc0tR/ABmG2IF06K7npeFiaXLl8 gkCNG9QL/HLNm7XmqWjwOsBri75rip8/uyuD/R6FBVZNfMGFT8bY1aT5t1bsycv6KtAR /7xpsYnIb1OXP02ZKV4AtXZYCNL+5mXHrFILEJiIbPlEatr210vjX2Y4hGp5Eo1bUwko OKGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+vKnE7X4C3wzlK1JmSQfpytc1qItyht9kBX7kY+JZA0=; b=MkWZ5P+QtV+iARDY3USv81rokAjCHrZo7FGsN/cStCvJ7iastmOc7RwZlEieYMf/v4 b5aixA3R0QodH8T+4fqMgS+r7MuGHw7RLWEstAxSAHYc3rzYy0OuKa8R6hQXtJgA4yZf 3Qt/kNzV6i1TC9EX9g9TlfDf6wW0YmcYGVEAGtWaO8gVYjV/8woHfZXiu/H1FvPUyHm+ r0FP5+MipJ83QblK3tHBS75yLoxxyOb4wd+QunWN9pACpPzGpIIYcIs5/FXR+spUgQyu 9P5ClUgLhOT6PSTSDJthlHQDWMGhv1tDjAnl2eOi4OpPsjZ28OP4moJ97bvner1PcMMC uStg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZLwjkmdd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds18si3300014ejc.591.2020.07.23.13.03.57; Thu, 23 Jul 2020 13:04:22 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZLwjkmdd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbgGWUDs (ORCPT + 99 others); Thu, 23 Jul 2020 16:03:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgGWUDs (ORCPT ); Thu, 23 Jul 2020 16:03:48 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FC90C0619DC for ; Thu, 23 Jul 2020 13:03:48 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id y18so3942592lfh.11 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=uCsCp0C+08wnrpkuMQSSNGngs22gTTn34dWH5rzw6Qv5hqSfUN6IHiOzWUvaAn4pYI p1azUHoy3EV1OtkcJDqSbYKsX4+RLPvP3ZhplF5XtyF/UhH3Gyb4HQZAwgd5/Yh4/c3o /ZAilJj7BekQigcmPIrTWkYJ3XU+Ewe3VrqZ5lqqU5TNVhhUWfLvkcYTXQWVK8sKAVIr uWRdshG9sG30C3NPT6Ea2uVnlCV5AN3F03YRJS2/PWvqsfUCGlcbGz0FLOKdXFylgew3 vjNQfUnx4l0L0qTZQjNBJAq9gGeSRXykm/5VaUFDAuQ4xEIgFc8hYy8m3kgD47Ikt3lp vtuA== X-Gm-Message-State: AOAM532AgS0hxgZVz4uvhKUVNPf/wnzdh1gSgX9jlo4VvPnCrhtIJ7YD GFZsP8gba3f/hSHIMXTxWiWwvo/VtVk= X-Received: by 2002:a05:6512:4cc:: with SMTP id w12mr1860331lfq.99.1595534626220; Thu, 23 Jul 2020 13:03:46 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id i11sm3273420lfl.31.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-f45.google.com with SMTP id y18so3942526lfh.11 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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