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=-0.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 2A38CC4321A for ; Fri, 28 Jun 2019 02:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01DFD2147A for ; Fri, 28 Jun 2019 02:39:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="2BroReMx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727064AbfF1Cjv (ORCPT ); Thu, 27 Jun 2019 22:39:51 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:43297 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727041AbfF1Cju (ORCPT ); Thu, 27 Jun 2019 22:39:50 -0400 Received: by mail-ot1-f66.google.com with SMTP id i8so4447464oth.10 for ; Thu, 27 Jun 2019 19:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i+w5fn2Y32/L39vIbDWdR2CfVz49VqoI4F4CB/r+uKs=; b=2BroReMxSyl7fumvZHFYCsXog9so/PwacI6uZo45fszzwoTUhDjTDVIC3dmDgkvhjI 1vPIrM+hSnKeAwrkzbGzAjTEPTTgmqOwCVSZQUdIDrvAxKA2cMV8Dr6GunOjfoKKRYiR i8n913ea5p94gaxe2NpjIpJwUJ2qhzkQ+wHLtf//YGUdDQeqhjuL7sHzp6EjAr//ec01 XTKGHBCDcdPjUSb8oFPiQDfaUdsVI1ufjKYoVyP6pZsvPych6kooqkVWEaGAH73GpfeW Q64A9UAnw0STfqhTNC283nlq9ZOnnmCyzDAjw3roZzNRDyNGYbLpCBliRHdGmg3LI7kY Wv/w== 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=i+w5fn2Y32/L39vIbDWdR2CfVz49VqoI4F4CB/r+uKs=; b=PGL9K+CpLFQFnm552+XLE9vglxVQkP8jXJUugp0rDVpd6FwMYz/KL+C5fgJSKDYz+A sH2m7Ybl/i/wyATtEEARrodXzbn+Xf57wtOgT4OuBOSEAapNzPzsTBI/WFRA1kLHZdVU gx74oG7S6AGLdLWDnnE/T53on8Hjw87D90DmNVtOhSY5pUM+JPOgIwDNmUuKYLtMhaFd gXlaU2HCpARIpaPKqkYrR9gApM+n2jSWhaowfDunDyVR0TsvHOelj8jFRn7z35yabkp0 LoMIlIixVYjblmPJ9+qJd2o9Vi+DMAQxzLYXVI6jGrt4MeS8ExSYLUyiXDtanzP2m/cB bVyA== X-Gm-Message-State: APjAAAWSuSI9BuRhN0+AG+uA9a8AndyqD6hzpgAE+LmHmdYH9ks9ieKx NmmcB1JRCbalgbxosuk6aozctLtGRUTw/g1Zb5su7BpdYkg= X-Google-Smtp-Source: APXvYqwSf5cu88/vylJhhX2x15ji/SfzGkHLqjJ94ZW0+LXDsKMlI1/GoQT5qpbwxtU93udva3CYg32AyPTcsoNMv3U= X-Received: by 2002:a9d:7b48:: with SMTP id f8mr5967248oto.207.1561689589382; Thu, 27 Jun 2019 19:39:49 -0700 (PDT) MIME-Version: 1.0 References: <156159454541.2964018.7466991316059381921.stgit@dwillia2-desk3.amr.corp.intel.com> <20190627123415.GA4286@bombadil.infradead.org> <20190627195948.GB4286@bombadil.infradead.org> In-Reply-To: <20190627195948.GB4286@bombadil.infradead.org> From: Dan Williams Date: Thu, 27 Jun 2019 19:39:37 -0700 Message-ID: Subject: Re: [PATCH] filesystem-dax: Disable PMD support To: Matthew Wilcox Cc: linux-nvdimm , Jan Kara , stable , Robert Barror , Seema Pandit , linux-fsdevel , Linux Kernel Mailing List 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 Thu, Jun 27, 2019 at 12:59 PM Matthew Wilcox wrote: > > On Thu, Jun 27, 2019 at 12:09:29PM -0700, Dan Williams wrote: > > > This bug feels like we failed to unlock, or unlocked the wrong entry > > > and this hunk in the bisected commit looks suspect to me. Why do we > > > still need to drop the lock now that the radix_tree_preload() calls > > > are gone? > > > > Nevermind, unmapp_mapping_pages() takes a sleeping lock, but then I > > wonder why we don't restart the lookup like the old implementation. > > We have the entry locked: > > /* > * Make sure 'entry' remains valid while we drop > * the i_pages lock. > */ > dax_lock_entry(xas, entry); > > /* > * Besides huge zero pages the only other thing that gets > * downgraded are empty entries which don't need to be > * unmapped. > */ > if (dax_is_zero_entry(entry)) { > xas_unlock_irq(xas); > unmap_mapping_pages(mapping, > xas->xa_index & ~PG_PMD_COLOUR, > PG_PMD_NR, false); > xas_reset(xas); > xas_lock_irq(xas); > } > > If something can remove a locked entry, then that would seem like the > real bug. Might be worth inserting a lookup there to make sure that it > hasn't happened, I suppose? Nope, added a check, we do in fact get the same locked entry back after dropping the lock. The deadlock revolves around the mmap_sem. One thread holds it for read and then gets stuck indefinitely in get_unlocked_entry(). Once that happens another rocksdb thread tries to mmap and gets stuck trying to take the mmap_sem for write. Then all new readers, including ps and top that try to access a remote vma, then get queued behind that write. It could also be the case that we're missing a wake up.