Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3156512pxk; Tue, 15 Sep 2020 11:28:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYJPtUemavNF2XS539Lz7hxyEwb4Xtd3cXZLDDlBOqq2hkEw6SlXzIAg+h3Vtcj1ibZ8rK X-Received: by 2002:a50:d54b:: with SMTP id f11mr23725315edj.329.1600194535291; Tue, 15 Sep 2020 11:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600194535; cv=none; d=google.com; s=arc-20160816; b=wGwJRx/6gaaO3EnNLATtc6hDJUSufuf3DCOe+mToy+OFr9HEvyRWXYIjc0C8NYDBIV hdyRnok9gBEwlJuBVNkzPFocL9y/eW8yj2d6ymvv2DMX233AbEQ8s+08H5dO9WX3ohuX MA8OS4QTPkDl/j+xrVTMw6nG5181pRiAKaNnls8OgH3vMbcm8Dktqk5m7H5EBB9bz66n Tdn5qF4YzZHhOSUH7lvOnwQL6K0ksHgRTVnR4JcddkpmxLBcoLUwPMGtSDp2MQlLi2eB VvO+biHxM/a76gfrdRsOliFazP9dshh5ARoK2ydun6emiBBn+n/HwPp81qB+MZ9QW47+ 1nxQ== 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=Qd9UQxfut0hXXZzFJT2meuy74mIWL2uFMX8QA4+AqJg=; b=qPfEDdYDTIwEO0YYULMA21z3dq0nReB2v2FEqIX/BYHWKRIGjU80/FC8BczFLe8TWF 53xsMSS9k6c1llAUpAg3Ck23ZagQiiWdAMr+vptWq6mHmpZusZU9UrBjn/WQIgI9FMLe F5oPDqpbPeIs+4stuVSFmC4WoJ8UUe71b3zhs0crdP57X2bnSh10Y7GdgiNWmZhEneR0 WtnA6dMkotWivk1UyMJGjZWHXfRokPxxr43fJbEAsIKkUHW2AyJcLM9CuchTZctc91ai fdGgRrWHib26EPSTFN9vbdkn8VBJH4GHAQEkE2OZysnU1/nWEto/5zTh4vxlS+5Nci4s XjLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=YZCLf5Kw; 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 x1si9796016ejw.494.2020.09.15.11.28.24; Tue, 15 Sep 2020 11:28:55 -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=YZCLf5Kw; 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 S1727559AbgIOS2J (ORCPT + 99 others); Tue, 15 Sep 2020 14:28:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728011AbgIOS1k (ORCPT ); Tue, 15 Sep 2020 14:27:40 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59ECFC061788 for ; Tue, 15 Sep 2020 11:27:40 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id y4so3686297ljk.8 for ; Tue, 15 Sep 2020 11:27:40 -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=Qd9UQxfut0hXXZzFJT2meuy74mIWL2uFMX8QA4+AqJg=; b=YZCLf5KwWovlmSfLKqpmzcDEAyF10UYUc9DhZZy90MM3OUQp+Ev1oCFxtSUDRKXzd+ LlCn0zf4uazyNTtCJH26wj7kEXvoCzPV6Qb7BXxj/r9ifUPX3DcozQleedXwAZN9ZGEo zmKHlYAru5kQsLQh0RPI5YC1rKJiqPlN+n6D8= 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=Qd9UQxfut0hXXZzFJT2meuy74mIWL2uFMX8QA4+AqJg=; b=UKS1E2e5Ct0nXCROXUnRp0uAOUfQjTz+0OBK1sS1vfs14ALvvs8ErMKsWL4CroUEy1 uQB6eM48X5W5XYP6ptw1SxRNA3iI75jI0+Zv+oStq+kJYH3pj8Usgc8Ev0iOxZ2/el8s 4roe4igdnVii8e5zsQ2JE5DDeUJCfjWV5V5zEUZ30N6j1aVPs5LlxxTn4eVIFlIPIS9E o4ks4UEARcGVWOOZVA9X0Tkv0SErPUa+QBONFC4d+s+ZenKqkC5NyQM+f8Tzgb6sSHVO +MdOASVcVWO8Qi6PXH0+JCuGeCvcnzgJ7ztG3o8XvFKh/5AVueRoQWlYznRuSskHWmmg aDdw== X-Gm-Message-State: AOAM532OVw2S89W3YvdfUSc3ZqQiMYbyX/+b/VgYLk9EPyC7xnuWka58 vaci4h1+ph4qq4GJoMVT9AdgnV8B6Blarw== X-Received: by 2002:a05:651c:1056:: with SMTP id x22mr8024555ljm.81.1600194458326; Tue, 15 Sep 2020 11:27:38 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id n3sm4805062ljj.59.2020.09.15.11.27.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Sep 2020 11:27:36 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id s205so3692384lja.7 for ; Tue, 15 Sep 2020 11:27:36 -0700 (PDT) X-Received: by 2002:a2e:84d6:: with SMTP id q22mr6691288ljh.70.1600194456034; Tue, 15 Sep 2020 11:27:36 -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> <9550725a-2d3f-fa35-1410-cae912e128b9@tessares.net> In-Reply-To: <9550725a-2d3f-fa35-1410-cae912e128b9@tessares.net> From: Linus Torvalds Date: Tue, 15 Sep 2020 11:27:19 -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 Tue, Sep 15, 2020 at 8:34 AM Matthieu Baerts wrote: > > > 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). > > Thank you for this idea! I was focused on using lockdep and I forgot > about this simple method. It is not (yet) a reflex for me to use it! > > I think I got an interesting trace I took 20 seconds after having > started packetdrill: Ok, so everybody there is basically in the same identical situation, they all seem to be doing mlockall(), which does __mm_populate() -> populate_vma_page_range() -> __get_user_pages() -> handle_mm_fault() and then actually tries to fault in the missing pages. And that does do a lot of "lock_page()" (and, of course, as a result, a lot of "unlock_page()" too). Every one of them is in the "io_schedule()" in the filemap_fault() path, although two of them seem to be in file_fdatawait_range() rather than in the lock_page() code itself (so they are also waiting on a page bit, but they are waiting for the writeback bit to clear). And all of them do it under the mmap_read_lock(). I'm not seeing what else they'd be blocking on, though. As mentioned, the thing they are blocking on might be something interruptible that holds the lock, and might not be in 'D' state. Then it wouldn't show up in sysrq-W, you'd have to do 'sysrq-T' to see those.. From past experience, that tends to be a _lot_ of data, though, and it easily overflows the printk buffers etc. lockdep has made these kinds of sysrq hacks mostly a thing of the past, and the few non-lockdep locks (and the page lock is definitely the biggest of them) are an annoying blast to the past.. Linus