Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp361010ybg; Sun, 26 Jul 2020 06:58:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHdW6edQMbyiGq/X1uzHk+TTtpobSij2Ae/Um8Vw20gATaywC6si9B7u9F5GRFmkK1YvBs X-Received: by 2002:a05:6402:b45:: with SMTP id bx5mr1493537edb.22.1595771904786; Sun, 26 Jul 2020 06:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595771904; cv=none; d=google.com; s=arc-20160816; b=j+SSv0tqZLdHMkXsD9px4vySNs7sKT0zgX1X3v2QrFoz4Wm9IxqCvOYl3bDmKs0Iy8 cm9+Jiuv8sXXa2tBIX2PuhCJOoxaiN9DMcZYHf9SxStVpSUSdljSE6eKwobpWJXO9CDq VuzCFa75N1otkhOzKB5a4yI0RuJtOTxclSgnqAbe6yQGKe2DY30pK65Km/fuMZb9ajnq 5uMu/NOf2EM4Z0XCvOBWNk+lmnPermUHXucmB1AQRwMBN/7J5q90aXTcRCVrhSDoeaIx EAJpomFa/uJxm+mtxJFnxrv/FvplCOWVIMb14Bwj16po4YkJdCBvtDV26NQ2lDlYFa2u It4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=h6baPv1PbnRySH8ZZBtT2emXkXeca9+Q0TLzoLgXvgU=; b=I7olX9FimUodI1DMNr8kKHJQ0uk5gsAQZFv4TIf1LxPRFzWI+gemW2U31o5vMU+KJH 8zPQZ0RP2sSzW+KqemaVDH6K9ZECnoBwapuYl0Nd7UeM+ZatVzmk6BtgVNzuPYp5yxaa 7qgpO6qhREjctcmM2Xs3zg6jFB19jllCw+TEqg18vOGvXLBWf46G0iZ1bHIbRhnpuG0a nC8Viegg4QAHuMFHDKAq3N1EBaiq0/gcp7Vew+YgBuSXuCiSr2h/jAX8fBmAIBYeEz+t KWduga2hJ4Q6jGNxszyK9KiFYYqwNRncri4I2rRXf7SNESAEHBmDZEoAg8bzi35ist5M V31w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JFXeLsb4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si3830934eds.562.2020.07.26.06.58.02; Sun, 26 Jul 2020 06:58:24 -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=@redhat.com header.s=mimecast20190719 header.b=JFXeLsb4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgGZN5Q (ORCPT + 99 others); Sun, 26 Jul 2020 09:57:16 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:31000 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725848AbgGZN5P (ORCPT ); Sun, 26 Jul 2020 09:57:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595771833; 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=JFXeLsb44k4hfM8EDy+JwxkZOnQZ+XyNmrFSGO6lqbRPnllVhfB/BQY+u+54LLL2DypMgA cVDn8sj3wQEB5yOFMN6pBpObX9kr6bIaVyCvmbYT3tX7QWSnSTWWSNjDCmR4sdqywXeSdp PT6ByFX13fqUTr4faEnEwu2n0TVi5aE= 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >