Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp3154829ybh; Sat, 25 Jul 2020 12:53:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk6vFSluWk2hRAIVfAAho7Df8CYAYLYPFE6y4k3pPdVC1pHMF0YGsV5BLX6TO9EzvZqvYw X-Received: by 2002:a50:c402:: with SMTP id v2mr12109220edf.166.1595706824109; Sat, 25 Jul 2020 12:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595706824; cv=none; d=google.com; s=arc-20160816; b=KhjWQdSAusfjFXYtBbS8PnsJUYRrffaW9xKiWCW6mHgpoTGByKkWw620HjZRUdDfjx xHBB3MHiul9y1dECtQa4ffvq2Qj/6WMQV0ELiKjrHew+VnwKkMwdsQXtfSKECrqIYYsT GkR+30SaS6eUkliNqV0BWui6UWG1LMiIwkGdRyX7Vr3DOJIeLXYjj8/bao7Cyrhl9pi6 MrfLFpfWNC9baJQE051SOcjQWI2nII+BmTdTIyGvm+j2/QCO+wjFHWAOsB1oyNGBh3ts J8bVtZXlcJ5blvYSDpIoDxszaPHsLpTakaH4id1xCrxuyu8p+31KkZery4orva/N45Bb sUDQ== 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=Wl5O80oi/Kt/8fZrQY34GOq/Z5L129JRgfrldDVSyAU=; b=kM01l+jhGVohOZnDvzSdVgL7m9R5wkqSefOv7VTcWa5v4o0bYT4KJVcp9DDP2nYt4f 00r0to7CQB/FOXMrjOfIz5suTM/bjN2wJO6p9aRhrK/YYunSgNtCu54uC3lKdTMnhhjj lJxdjJH44hoSrey2Nq8Ze4lZPoO3bDWElTOk+YxVczbmbpAwaTP/8qkTmaP9D4AaTLg9 VPyhCefp5xhQo7AKnZCklRylqU5rquryG0bvgxJ7OcxEjdQGjCYVAdulk5kI5xp8CbdM ZjIPNjYPEQrSbeGmkA/P2uphMCDm89czqwdB09VbKWBl1YlQ9zoRTNOO2gmoEAhoHHdT DqXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=cxrfqdzl; 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 s3si2722806edq.57.2020.07.25.12.53.21; Sat, 25 Jul 2020 12:53:44 -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=cxrfqdzl; 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 S1728028AbgGYTwK (ORCPT + 99 others); Sat, 25 Jul 2020 15:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727929AbgGYTwJ (ORCPT ); Sat, 25 Jul 2020 15:52:09 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A195DC08C5C0 for ; Sat, 25 Jul 2020 12:52:08 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id t6so341259ljk.9 for ; Sat, 25 Jul 2020 12:52:08 -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=Wl5O80oi/Kt/8fZrQY34GOq/Z5L129JRgfrldDVSyAU=; b=cxrfqdzllM3VDmJvOgE1o7/Ek14r9LdBvxRMahxlJhHW+QB9pagkd9nAIyEMLNILPh zCA4q9ToZ5ZsiZa12hEmLeH4toTVybbo9HDx3r8ngRndexI/92KurLTWfsgSFlOmt7pP whwRb+gytczc3CSOdmLWyRx2FIFh5HiYPnlpI= 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=Wl5O80oi/Kt/8fZrQY34GOq/Z5L129JRgfrldDVSyAU=; b=eIKOyDQEEL+h+TWcFdfbWP8alHbdcFFKiG8hi3cTcQLqVmTjzye3bIy+g0/DSo6C29 aY4oZfUwfEbgvbog82vSOzXwAtyVR9w9CiIaIcdEYYhsQQaIuop8B4WxI1Rl9/WVjFBF 5xT9FBvyM/EJZU7fq5SFezu+py8D81J1/UyJewvpgxA/yWlTKRb8tIwV6Q/hBkhkdGmQ IMJ4i4lu9Kf9j97pjhyDHntoyGqWGpi2LwLExiFXYhM3Bel83NB9dyGeYU37DZ75yebj ZiP2JI63v8zPOfgaWu43i7yKjFb180Np8Wy+I9R27BvGxa5IPxUcUD1vUsH4bZI+bOGY 81Dg== X-Gm-Message-State: AOAM533r+mc9wAeBGIwPCRFGXV60wC8+Q/HoQ5jkTUokpmFcW3+fe23D rYxUPyMh+zYtWmwcnACQQ8HE/leH46g= X-Received: by 2002:a2e:9594:: with SMTP id w20mr6283564ljh.26.1595706726727; Sat, 25 Jul 2020 12:52:06 -0700 (PDT) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id 204sm1611535lfm.86.2020.07.25.12.52.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Jul 2020 12:52:06 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id i19so6953560lfj.8 for ; Sat, 25 Jul 2020 12:52:05 -0700 (PDT) X-Received: by 2002:a05:6512:2082:: with SMTP id t2mr8290886lfr.142.1595706725545; Sat, 25 Jul 2020 12:52:05 -0700 (PDT) MIME-Version: 1.0 References: <20200723124749.GA7428@redhat.com> <20200724152424.GC17209@redhat.com> <20200725101445.GB3870@redhat.com> <20200725192753.GA21962@redhat.com> In-Reply-To: <20200725192753.GA21962@redhat.com> From: Linus Torvalds Date: Sat, 25 Jul 2020 12:51:49 -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 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