Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2516367ybb; Fri, 27 Mar 2020 07:05:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvFxqNo42FE60A2gxP4QhmAgr8U2O9TydPn5wbQ2rxMLYfxroxur9NZSERasVKFgbxMZ+H4 X-Received: by 2002:aca:3c56:: with SMTP id j83mr4218012oia.52.1585317954432; Fri, 27 Mar 2020 07:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585317954; cv=none; d=google.com; s=arc-20160816; b=KvzLJo+a5wW0qXCUwAuoHjLZKP9Plqsy55msgK1yPqleJYmcx8YNawIgZWzE4WXVOA dZcP7qTOykaOsu/+rbppIWJOSc7vFA38awFPC/tS/5aOqT7Fva+4RkRlJmxvRh+8uSCB aDVuORzUpTRMqrLafcgb+z9/r0PSu6ZYLfNDHXVEKxoDpHJrGvwr9xHTL5ftMtHZXxNo OZn17mGWPgMaNaEY3qCilhed5FlHTOc13uHF7PW6YJtps62y+OF9tZ2vgejH7I2CrPrp pqPYgNKlrM/QmCNhKdjKg3XpLlRQZQ4l3AuSjFm4htc+3jkVPKBeqOr7eagMes7JWRLG mgWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nmGn2iu/6hb//kS/DiygB1sR/c0YTQN3IceTCMDHJQI=; b=CFWlQtpdd+twlJ3z1v+FsXenHb5Zd7IegOAKKMIFFxOYu1YWctdEmiTcPDG8gCZ1xl PEdhJr6D8/RlYiJt88r3crF7x5NdG5Trq/nME9gXFhuJ90upm0Y7HajEqCeWiSausocG OKi4Ew1unF7yUETQ+e/GZkvtn9gSoyAm6L9zYIv5qrRAu0h9jyxb/d9zmQlNVLTdEFYH q9kCrctk4SOh33dHRI1zbJvGdLcjgGQwL0MtmVhMRcDRuCAprYtgrIWjnu6grf8ebIYz 2h2nZ5VYIR/5xp/zEgD40P7laHPy6oFgVmhoZOGCl8B7KXfjKdxZopizygFS2yZUnqOq cOdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q4Y6MQ8M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p203si2529776oic.214.2020.03.27.07.05.27; Fri, 27 Mar 2020 07:05:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q4Y6MQ8M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727336AbgC0OBa (ORCPT + 99 others); Fri, 27 Mar 2020 10:01:30 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:54732 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbgC0OB3 (ORCPT ); Fri, 27 Mar 2020 10:01:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585317689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nmGn2iu/6hb//kS/DiygB1sR/c0YTQN3IceTCMDHJQI=; b=Q4Y6MQ8MtI0Dc3KPYFS70IytyzW90zN8cPLRhQvUpNiPSGhOVgXoAYwnsXoTX/s/JmFrX6 4Q3xCR58wuBX42kAV15IcW6K16WwAS/pPveOC8JqY45R33ZjJ+lDmJbOKSitYGVPpNWoO0 PhPtXdIUlCn+HL+idUAvFn1awmwFlIQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-30-IhFdegswPqOnvQl_xs_QBQ-1; Fri, 27 Mar 2020 10:01:25 -0400 X-MC-Unique: IhFdegswPqOnvQl_xs_QBQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 331DC8018AB; Fri, 27 Mar 2020 14:01:24 +0000 (UTC) Received: from horse.redhat.com (ovpn-117-99.rdu2.redhat.com [10.10.117.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05F425DA81; Fri, 27 Mar 2020 14:01:14 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 3255B222D9D; Fri, 27 Mar 2020 10:01:14 -0400 (EDT) Date: Fri, 27 Mar 2020 10:01:14 -0400 From: Vivek Goyal To: Liu Bo Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, virtio-fs@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, mst@redhat.com Subject: Re: [PATCH 20/20] fuse,virtiofs: Add logic to free up a memory range Message-ID: <20200327140114.GB32717@redhat.com> References: <20200304165845.3081-1-vgoyal@redhat.com> <20200304165845.3081-21-vgoyal@redhat.com> <20200326000904.GA34937@rsjd01523.et2sqa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200326000904.GA34937@rsjd01523.et2sqa> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 08:09:05AM +0800, Liu Bo wrote: [..] > > +/* > > + * Find first mapping in the tree and free it and return it. Do not add > > + * it back to free pool. If fault == true, this function should be called > > + * with fi->i_mmap_sem held. > > + */ > > +static struct fuse_dax_mapping *inode_reclaim_one_dmap(struct fuse_conn *fc, > > + struct inode *inode, > > + bool fault) > > +{ > > + struct fuse_inode *fi = get_fuse_inode(inode); > > + struct fuse_dax_mapping *dmap; > > + int ret; > > + > > + if (!fault) > > + down_write(&fi->i_mmap_sem); > > + > > + /* > > + * Make sure there are no references to inode pages using > > + * get_user_pages() > > + */ > > + ret = fuse_break_dax_layouts(inode, 0, 0); > > Hi Vivek, > > This patch is enabling inline reclaim for fault path, but fault path > has already holds a locked exceptional entry which I believe the above > fuse_break_dax_layouts() needs to wait for, can you please elaborate > on how this can be avoided? > Hi Liubo, Can you please point to the exact lock you are referring to. I will check it out. Once we got rid of needing to take inode lock in reclaim path, that opended the door to do inline reclaim in fault path as well. But I was not aware of this exceptional entry lock. Vivek