Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2351004ybh; Fri, 24 Jul 2020 10:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAmXQBEitkdXp6kVVzjQNzdUKwh+mcLPOstep98eLM1mx7zS2zNdS+/aX/S0ERaK5K8NTn X-Received: by 2002:a17:906:950c:: with SMTP id u12mr9905869ejx.37.1595612033030; Fri, 24 Jul 2020 10:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595612033; cv=none; d=google.com; s=arc-20160816; b=ITObcJ5nqoRmgYE7tkbfBA9eSD9r/SHvxmxWW5X9huVSz1BBrpDSEm7DSW10pZjb/+ YHPvm9at5Slm7ocKSWZkKfvni0BarpfrF4MS9jatj7quw3y8+IHMVuZZdS8UI6gLjMzS cpt3OVJNKucNawD7QascnPwTH0g+tpnpLs9gSx7zVHABLrToUsA7A5fCxg42zmkPJH1n fv1uCXygza96p1zA2rHOLT0AJnPEWE1EDST4py53SuB1QEi4KH3JUlBYzpniKBOqSwhC nnMCQ0nS08t8ofyLlJAVuLSNQEIoLaBFeaVjm8wXgagtY6GYw24D40gL4rAFp4IbhLf0 unyA== 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=sDMr38FscR+XrA/gU+mtlRmZCLkS+iW+KqESdqmuTYU=; b=YsTBV3rj8bTJakGetwtH4XYKlt5axQTPFM0blfgK5PjIp42Khdp/L6eKf8I4jIueG7 0d/HtfJiflbVIllLU3uY/c9PC5NnrXPKng6t4xtQCBOV94zIR+sNznHfDMwK80uwixKb DqDmkgOmKr59gbhGUsRBWVJ7fZHg8rLGcOXV1Ax20yu84Yu+l8g8TZPBsLYu4kMjMD1i ExPA+uzXf/Es7LlWqiZxowsErMrg+D+Y4keI48+bYPPBE19/jKGLfFlFut8V92k20Ijo hgDfeXT18jtJgSfxHt90AP/aMNDw7INfGczzPrV6ND5N+YCMdlobFaCSC7DIx81n9VrP e64w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=dEBnYrkQ; 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 h24si953998ejt.451.2020.07.24.10.33.29; Fri, 24 Jul 2020 10:33:53 -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=dEBnYrkQ; 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 S1726625AbgGXRdN (ORCPT + 99 others); Fri, 24 Jul 2020 13:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbgGXRdM (ORCPT ); Fri, 24 Jul 2020 13:33:12 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AEA9C0619D3 for ; Fri, 24 Jul 2020 10:33:12 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id h19so10745494ljg.13 for ; Fri, 24 Jul 2020 10:33:11 -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=sDMr38FscR+XrA/gU+mtlRmZCLkS+iW+KqESdqmuTYU=; b=dEBnYrkQQS1Qr6YXmG1uGXF3j4FiYmJScq0B5yzKZu2B66PKoC/12/YDk4ygVqqyvB Ka6St6mKW0h3XFLt9f5nZaAoVjxaXXMXw3LHEucUrO2t/kgcx3dy6+Ivhq7Fo1QNjmb4 6SFhEDlZcIOLIUIGHaaOTU3494AikzsnziA14= 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=sDMr38FscR+XrA/gU+mtlRmZCLkS+iW+KqESdqmuTYU=; b=uPcukpMurjAGKOT51lFWBOZN7g8fpyY7yPbmEz8HU0J9n3b0e+SiaMGi39PAC04W2Z ISG4BCcerwktf62e3Awqci8rNJp22Mo5T0C14tQKaKJUG8vN9ebS6eIE5BxKViXiwmIn Nlj0q2xqdVzY6aLr0ZMjb5q6+s/pEqmqsJZs0vbQ2D+kiV0uiVnxpH6ovu02SXSX8Nss miAsAoHLaR6r8jzRS3xRw5+Q9vSnx+MENL2BVcULuqIu/dqF4YpS1bm+70XqcflIIn8A cWNpm1GtSpoNWZcDQKKK48iJ6N3kJvhw8S+NO3Y6oLd0C+vN8rbSOwyz4jo22FkMlT5C D86w== X-Gm-Message-State: AOAM530Cbxx4bdjWnhzuJ+u6BOFxBm65K+Tpa8QdiUQ1W3KB6nj1hlhE tVm4Ek80knMnkxIcmcRbxn+K1l8uwZM= X-Received: by 2002:a05:651c:88:: with SMTP id 8mr4540926ljq.136.1595611989965; Fri, 24 Jul 2020 10:33:09 -0700 (PDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id i24sm441340lfg.83.2020.07.24.10.33.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Jul 2020 10:33:08 -0700 (PDT) Received: by mail-lj1-f178.google.com with SMTP id r19so10733023ljn.12 for ; Fri, 24 Jul 2020 10:33:08 -0700 (PDT) X-Received: by 2002:a2e:991:: with SMTP id 139mr4663078ljj.314.1595611987841; Fri, 24 Jul 2020 10:33:07 -0700 (PDT) MIME-Version: 1.0 References: <20200723124749.GA7428@redhat.com> <20200724152424.GC17209@redhat.com> In-Reply-To: <20200724152424.GC17209@redhat.com> From: Linus Torvalds Date: Fri, 24 Jul 2020 10:32:51 -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: multipart/mixed; boundary="000000000000bc5df305ab335d94" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000bc5df305ab335d94 Content-Type: text/plain; charset="UTF-8" On Fri, Jul 24, 2020 at 8:24 AM Oleg Nesterov wrote: > > not sure this makes any sense, but this looks like another user of > trylock_page_bit_common(), see the patch below on top of 1/2. Ok, that makes sense. Except you did it on top of the original patch without the fix to set WQ_FLAG_WOKEN for the non-wakeup case. And in fact, once you do it on top of that, it becomes obvious that we can share even more code: move the WQ_FLAG_WOKEN logic _into_ the trylock_page_bit_common() function. Then the whole thing becomes something like the attached. I added your reviewed-by, but maybe you should double-check my changes. Linus --000000000000bc5df305ab335d94 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-mm-rewrite-wait_on_page_bit_common-logic.patch" Content-Disposition: attachment; filename="0001-mm-rewrite-wait_on_page_bit_common-logic.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kd0i5y4d0 RnJvbSA3ZGQyOWIwMTVhOGYyNTllYTFiYmFkOTU0Y2Y4ODhlN2ZiMmZlNjVmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW51cyBUb3J2YWxkcyA8dG9ydmFsZHNAbGludXgtZm91bmRh dGlvbi5vcmc+CkRhdGU6IFRodSwgMjMgSnVsIDIwMjA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lX2JpdF9jb21tb24od2FpdF9xdWV1ZV9oZWFkX3QgKnEs CiAJICogYm90aGVyIHdpdGggc2lnbmFscyBlaXRoZXIuCiAJICovCiAKLQlyZXR1cm4gcmV0Owor CXJldHVybiB3YWl0LT5mbGFncyAmIFdRX0ZMQUdfV09LRU4gPyAwIDogLUVJTlRSOwogfQogCiB2 b2lkIHdhaXRfb25fcGFnZV9iaXQoc3RydWN0IHBhZ2UgKnBhZ2UsIGludCBiaXRfbnIpCi0tIAoy LjI4LjAucmMwLjMuZzFlMjVkM2E2MmYKCg== --000000000000bc5df305ab335d94 Content-Type: text/x-patch; charset="US-ASCII"; name="0002-list-add-list_del_init_careful-to-go-with-list_empty.patch" Content-Disposition: attachment; filename="0002-list-add-list_del_init_careful-to-go-with-list_empty.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kd0i61h71 RnJvbSA0NmFjMmRkYTYyMzY2NjAzNGIxYjFhMGI0MWJiYzE5MzRlZDM5NmQyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW51cyBUb3J2YWxkcyA8dG9ydmFsZHNAbGludXgtZm91bmRh dGlvbi5vcmc+CkRhdGU6IFRodSwgMjMgSnVsIDIwMjAgMTI6MzM6NDEgLTA3MDAKU3ViamVjdDog W1BBVENIIDIvMl0gbGlzdDogYWRkICJsaXN0X2RlbF9pbml0X2NhcmVmdWwoKSIgdG8gZ28gd2l0 aAogImxpc3RfZW1wdHlfY2FyZWZ1bCgpIgoKVGhhdCBnaXZlcyB1cyBvcmRlcmluZyBndWFyYW50 ZWVzIGFyb3VuZCB0aGUgcGFpci4KClNpZ25lZC1vZmYtYnk6IExpbnVzIFRvcnZhbGRzIDx0b3J2 YWxkc0BsaW51eC1mb3VuZGF0aW9uLm9yZz4KLS0tCiBpbmNsdWRlL2xpbnV4L2xpc3QuaCB8IDIw ICsrKysrKysrKysrKysrKysrKystCiBrZXJuZWwvc2NoZWQvd2FpdC5jICB8ICAyICst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