From patchwork Mon Oct 5 20:32:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 7331601 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76C48BEEA4 for ; Mon, 5 Oct 2015 20:33:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C52C2066A for ; Mon, 5 Oct 2015 20:33:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3470205F3 for ; Mon, 5 Oct 2015 20:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751887AbbJEUdG (ORCPT ); Mon, 5 Oct 2015 16:33:06 -0400 Received: from mga09.intel.com ([134.134.136.24]:5306 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbbJEUdF (ORCPT ); Mon, 5 Oct 2015 16:33:05 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 05 Oct 2015 13:33:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,640,1437462000"; d="scan'208";a="819995350" Received: from theros.lm.intel.com ([10.232.112.146]) by orsmga002.jf.intel.com with ESMTP; 05 Oct 2015 13:33:04 -0700 From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Alexander Viro , Matthew Wilcox , linux-fsdevel@vger.kernel.org, Andrew Morton , Dan Williams , Dave Chinner , Jan Kara , "Kirill A. Shutemov" , linux-nvdimm@lists.01.org Subject: [PATCH v3 3/3] dax: temporarily disable DAX PMD fault path Date: Mon, 5 Oct 2015 14:32:54 -0600 Message-Id: <1444077174-22016-4-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444077174-22016-1-git-send-email-ross.zwisler@linux.intel.com> References: <1444077174-22016-1-git-send-email-ross.zwisler@linux.intel.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is currently a deadlock in the DAX PMD fault path because it ends up taking the same mapping->i_mmap_rwsem twice. The first take is a i_mmap_lock_read() near the beginning of __dax_pmd_fault(), and the second is __dax_pmd_fault() -> unmap_mapping_range() -> i_mmap_lock_write(). We are re-working the way that DAX does its locking for v4.4, so for now just disable DAX PMD faults and fall back to PAGE_SIZE faults to make sure we don't hit this deadlock. Signed-off-by: Ross Zwisler --- fs/dax.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/dax.c b/fs/dax.c index f364c90..d42217d 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -534,6 +534,13 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, unsigned long pfn; int result = 0; + /* + * There is currently a deadlock in the DAX PMD fault path. Disable + * this path and fall back to the normal dax_fault() path for now + * while we rework locking. + */ + return VM_FAULT_FALLBACK; + /* Fall back to PTEs if we're going to COW */ if (write && !(vma->vm_flags & VM_SHARED)) return VM_FAULT_FALLBACK;