Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2454066pxk; Mon, 14 Sep 2020 13:55:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz51l0kfYUWQ2pdjBLX+KWLHLxlwzLWnaEP7WYV4gsuMOhkdgm8l46RALh5YQwPU91uKGGV X-Received: by 2002:a17:906:2c01:: with SMTP id e1mr16948622ejh.128.1600116902218; Mon, 14 Sep 2020 13:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600116902; cv=none; d=google.com; s=arc-20160816; b=YCWtipZJgEP4c4VVqNnMvxw7ZJbVKfaW0LvmGrPZJaBjVLGF6Osz0qbuJTv2qW7ieX 4tTvmGTV/jxL8Chf5qtqWZgBbCqlD8KNAkpryPg8K/A/BO4uM3YbGAWJjMSujSMZOH7K uFjNqf44HxyYiVtBSRsdFRIW24QmtHy21i9gGLRTF39T2V26x6xDXHGq9QTuO9nV+RUi pk/eK/NQ0ZfTcGw4v40bk5mqLalJo0liqIwnO75OtTN8uzW+gQU+FWK+pHt7qVd3RGm2 IkVSfaEmDnGTL3P9LNw57odsp/6Xq6psEGuLFuGdcCvdGD49/NCQie2rnyvM75O5Ribl GiuA== 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=D6qVsUwsNb0PU6wGHE3vfJih+i2SYx/Y/nPHj6WpL54=; b=UpTHyOafaHl28ze8xL3jD9Iv5HNCT8FfuzNnWs6Mtc9z6cSzaSlkl71w9xrI5TlGGz rBmuet+PRNa/U1NKTiUFEYGened2959xx74w4CWrajp6Fbv/FBrOBCS9Lkvs78aqN/Ia HvnjE6JpavTksCSjZND/P8+VEtRckxZuA/sZUI7mJgEuvhJcRwLKtgULdNOrUerbing5 33AYYVoob5kf84B82++TaSYS79z+x7vWi2xp/T8TB5YaqJ719ZhXV2+TIOFcSntmXQZq 6HQkWko1q6/F4ShoNSSRjyZk0Ut8imU+23s7kTwOlw9GLLNdzJRwekuFG7PAXzriSLZ3 KrCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=e8VuIxqe; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 o15si7935438eds.367.2020.09.14.13.54.26; Mon, 14 Sep 2020 13:55:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=e8VuIxqe; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726100AbgINUxy (ORCPT + 99 others); Mon, 14 Sep 2020 16:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbgINUxu (ORCPT ); Mon, 14 Sep 2020 16:53:50 -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 F0F7FC061788 for ; Mon, 14 Sep 2020 13:53:49 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id k25so913355ljk.0 for ; Mon, 14 Sep 2020 13:53:49 -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=D6qVsUwsNb0PU6wGHE3vfJih+i2SYx/Y/nPHj6WpL54=; b=e8VuIxqe+l4+N84yRJC6lPyclo5rDs0V1EJHccxRpspBH1/hPrJMWVpmRYrNpZlY4Q FKEF4V9DfJ1Dr3Z7iQwmMM0KbjO5UHpasBwDFCdlJJBo9CJEgS8PNqAfA8pvRiU5BiNV fm5pBdYHfHO1UXjsxNwOcHkstcluHp4FqKGOM= 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=D6qVsUwsNb0PU6wGHE3vfJih+i2SYx/Y/nPHj6WpL54=; b=rwBpT45s0g2Dz1YzNBZSKqthFuR8UqZJHnaETyeGlHEHcQ/KGr6BrF81RDVwLaBm/f I7W8xKq6dYJhZIcuGyLCL6wplNJ86t1/8MrF0oAHyL2xWgNIlbc3M4KHmnOILhO2wuHK KQgcB+fdjr+80aURpZD1FlvpmzpvksZBLaCwQaJdB6EWAR30UbyOu34lW3C7s8eKCbkV 0kRryzEFYXYouSfrcerDxtPXK2IjyBln+49Gi9ERWeK87nlFOo4wOYPwjQrCnRmfDJzQ jpyMH/napWy88SJ8MBaprNGxpt1S62FWaJif59f4MLaQXl/tFT0MlyFILb5K1NcIt7s+ XlVg== X-Gm-Message-State: AOAM531YkB+C7vSHEJPAzEsKULLpG02vjtGrFInOULK94wlE1t66f11D kyNivnEqOPZrtwns0KlLtoYdCxoig4znMg== X-Received: by 2002:a2e:3318:: with SMTP id d24mr1867410ljc.465.1600116827380; Mon, 14 Sep 2020 13:53:47 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id k15sm3493103lfc.261.2020.09.14.13.53.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Sep 2020 13:53:46 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id u4so845370ljd.10 for ; Mon, 14 Sep 2020 13:53:45 -0700 (PDT) X-Received: by 2002:a05:651c:514:: with SMTP id o20mr6044069ljp.312.1600116825294; Mon, 14 Sep 2020 13:53:45 -0700 (PDT) MIME-Version: 1.0 References: <8bb582d2-2841-94eb-8862-91d1225d5ebc@MichaelLarabel.com> <0cbc959e-1b8d-8d7e-1dc6-672cf5b3899a@MichaelLarabel.com> <0daf6ae6-422c-dd46-f85a-e83f6e1d1113@MichaelLarabel.com> <20200912143704.GB6583@casper.infradead.org> <658ae026-32d9-0a25-5a59-9c510d6898d5@MichaelLarabel.com> In-Reply-To: From: Linus Torvalds Date: Mon, 14 Sep 2020 13:53:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Kernel Benchmarking To: Matthieu Baerts Cc: Michael Larabel , Matthew Wilcox , Amir Goldstein , "Ted Ts'o" , Andreas Dilger , Ext4 Developers List , Jan Kara , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Sep 14, 2020 at 1:21 PM Matthieu Baerts wrote: > > Recently, some of these packetdrill tests have been failing after 2 > minutes (timeout) instead of being executed in a few seconds (~6 > seconds). No packets are even exchanged during these two minutes. Hmm. That sounds like a deadlock to me, and sounds like it's a latent bug waiting to happen. One way I can see that happening (with the fair page locking) is to do something like this thread A does: lock_page() do something thread B: lock_page - ends up blocking on the lock thread A continue: unlock_page() - for the fair case this now transfers the page lock to thread B .. do more work lock_page() - this now blocks because B already owns the lock thread B continues: do something that requires A to have continued, but A is blocked on B, and we have a classic ABBA deadlock and the only difference here is that with the unfair locks, thread A would get the page lock and finish whatever it did, and you'd never see the deadlock. And by "never" I mean "very very seldom". That's why it sounds like a latent bug to me - the fact that it triggers with the fair locks really makes me suspect that it *could* have triggered with the unfair locks, it just never really did, because we didn't have that synchronous lock transfer to the waiter. One of the problems with the page lock is that it's a very very special lock, and afaik has never worked with lockdep. So we have absolutely _zero_ coverage of even the simplest ABBA deadlocks with the page lock. > I would be glad to help by validating new modifications or providing new > info. My setup is also easy to put in place: a Docker image is built > with all required tools to start the same VM just like the one I have. I'm not familiar enough with packetdrill or any of that infrastructure - does it do its own kernel modules etc for the packet latency testing? But it sounds like it's 100% repeatable with the fair page lock, which is actually a good thing. It means that if you do a "sysrq-w" while it's blocking, you should see exactly what is waiting for what. (Except since it times out nicely eventually, probably at least part of the waiting is interruptible, and then you need to do "sysrq-t" instead and it's going to be _very_ verbose and much harder to pinpoint things, and you'll probably need to have a very big printk buffer). There are obviously other ways to do it too - kgdb or whatever - which you may or may not be more used to. But sysrq is very traditional and often particularly easy if it's a very repeatable "things are hung". Not nearly as good as lockdep, of course. But if the machine is otherwise working, you can just do echo 'w' > /proc/sysrq-trigger in another terminal (and again, maybe you need 't', but then you really want to do it *without* having a full GUI setup or anythign like that, to at least make it somewhat less verbose). Aside: a quick google shows that Nick Piggin did try to extend lockdep to the page lock many many years ago. I don't think it ever went anywhere. To quote Avril Lavigne: "It's complicated". Linus