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=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 70AD5C433DF for ; Sun, 26 Jul 2020 13:57:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 17C982070B for ; Sun, 26 Jul 2020 13:57:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YB3N1mv+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17C982070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 51E766B0003; Sun, 26 Jul 2020 09:57:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A7946B0005; Sun, 26 Jul 2020 09:57:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3704F6B0006; Sun, 26 Jul 2020 09:57:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1C9726B0003 for ; Sun, 26 Jul 2020 09:57:17 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8A8CE1EE6 for ; Sun, 26 Jul 2020 13:57:16 +0000 (UTC) X-FDA: 77080378872.15.net05_1606c7526f59 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 587181814B0C7 for ; Sun, 26 Jul 2020 13:57:16 +0000 (UTC) X-HE-Tag: net05_1606c7526f59 X-Filterd-Recvd-Size: 4840 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Sun, 26 Jul 2020 13:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595771835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=h6baPv1PbnRySH8ZZBtT2emXkXeca9+Q0TLzoLgXvgU=; b=YB3N1mv+zJ7y83L2P1OYUIEESQWOalxilW1EpXTxq2JSrYzHC8R+aOK8XIoD7s+JRddW4G CVqHWVE1UwrdQfX0U/VOiZHlOeFAL+tBx+0WrJ6c78vjy5Emb/r7y11ZYpb3OFxKpG4RE9 kf9OTHSxHiq0wupO4ECHHOpbUmLbj+8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-46pJdSpAMDq1mY3u6zwuaQ-1; Sun, 26 Jul 2020 09:57:10 -0400 X-MC-Unique: 46pJdSpAMDq1mY3u6zwuaQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42E7C59; Sun, 26 Jul 2020 13:57:09 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.29]) by smtp.corp.redhat.com (Postfix) with SMTP id 1F4015F1E8; Sun, 26 Jul 2020 13:57:06 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 26 Jul 2020 15:57:08 +0200 (CEST) Date: Sun, 26 Jul 2020 15:57:05 +0200 From: Oleg Nesterov To: Linus Torvalds Cc: Hugh Dickins , Michal Hocko , Linux-MM , LKML , Andrew Morton , Tim Chen , Michal Hocko Subject: Re: [RFC PATCH] mm: silence soft lockups from unlock_page Message-ID: <20200726135705.GA14017@redhat.com> References: <20200724152424.GC17209@redhat.com> <20200725101445.GB3870@redhat.com> <20200725192753.GA21962@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Rspamd-Queue-Id: 587181814B0C7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: Linus, I was greatly confused and tried to confuse you. Somehow I misunderstood your last version and didn't bother to read it again until now. Sorry for noise and thanks for your explanations. Oleg. On 07/25, Linus Torvalds wrote: > > On Sat, Jul 25, 2020 at 12:28 PM Oleg Nesterov wrote: > > > > What I tried to say. AFAICS before that commit we had (almost) the same > > behaviour you propose now: unlock_page/etc wakes all the non-exclusive > > waiters up. > > > > No? > > Yes, but no. > > We'd wake them _up_ fairly aggressively, but then they'd be caught on > the bit being set again by the exclusive locker (that we also woke > up). > > So they'd get woken up, and then go to sleep again. > > So the new behavior wakes things up more aggressively (but a different > way), but not by letting them go out of order and early, but simply by > not going back to sleep again. > > So the "wake up more" is very different - now it's about not going to > sleep again, rather than by ordering the wakeup queue. > > We _could_ order the wakeup queue too, and put all non-exclusive > weiters at the head again. And make it *really* aggressive. > > But since one of ourissues has been "latency of walking the wait > queue", I'm not sure we want that. interspesing any blocking waiters - > and stopping the waitqueue walking as a result - might be better under > load. > > Wild handwaving. We could try it, but IO think that really would be a > separate "try this out" patch. > > Right now, I think my patch will likely make for _better_ latencies > for everything. > > Lower latency of non-exclusive waiters (because not going back to > sleep), but also lower latency of walking the wait queue (because > fewer entries, hopefully, and also less contention due to the "not > going back to sleep" noise) > > Linus >