Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9789626ybi; Wed, 24 Jul 2019 10:00:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGf2apO27ucGw2FPxc3mAiIxPR7dQeeADjC+2LCK0/a3UEqta6YPD+/DbR4wwU8dkth7aB X-Received: by 2002:a17:90a:b00b:: with SMTP id x11mr89105651pjq.120.1563987621889; Wed, 24 Jul 2019 10:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563987621; cv=none; d=google.com; s=arc-20160816; b=eYOF+4VA5o8fu6t64qZfAWGO+OHF5h4fxXOZM/z9GqVbnjUCH0hor3avq6txaiDeW4 kfqrdNw18cGbApaRt6KDmriOXINOlCspgBKUbeKJhQTKnDi/uYPias4mhoQtbciwHVg6 uF7HUI9vR3u0vxTNurSL2kzpSO+LkF7F0WZGa6cxH3p1FvtPpMW023MjJcdasJ1cFZcR 0Lv7EW5zp3NEEc1As5QvPYn6NhV3fuLkWtmPuc5cUktL0JXFN6u2wBQyo5/855WyZ9Cd 5ZlfpvLNiQIL1F+1zFHYTE4PHUSUC8qKb6993FNNWkf69LY5dndnVqkNsWMwjdPnRBRf 3Gww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=HXDgC3r+QZndYF+JhGOtU3oBVmxVpcd58tRMaOLYpnI=; b=UhAhc6LbP/VtmGyI81cktszHXdA/tOliUak+kRFcYPFB53HmJoq2NQzjdeZG69LXzh HwsW209Loqr/VYV21q/PTG/QB0JdnsKH5M+cysabasRJOxxuSZRCh7jgvRzZvEvLD1pS vpRTnpqzdcWENS5td57hD4PEl56UGjEDvq+X9nMmcynsg/JzsHfo/lmSvtZ0qDEJp/Nd RMrgGD1YtfmJFVkeOe0MaXVUgmEKaRSybWFtrCIah4LIZLf5f5HGYAzmeRtxVMn09swH YElgNZyxTQjW9EFmi84+ZNkPuE29maK6GVrNxN5RY8x9kM2ucJmqat53Tqayca4bRcBR OGTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="d3D/6SvI"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i71si13462055pge.3.2019.07.24.10.00.05; Wed, 24 Jul 2019 10:00:21 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="d3D/6SvI"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728638AbfGXQJg (ORCPT + 99 others); Wed, 24 Jul 2019 12:09:36 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48190 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbfGXQJg (ORCPT ); Wed, 24 Jul 2019 12:09:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HXDgC3r+QZndYF+JhGOtU3oBVmxVpcd58tRMaOLYpnI=; b=d3D/6SvIZRlTvJ4R8TcVqF4SL7 PnO32n2UOdRKzi4R406Kmnuht+z1TH4GbopOWqBzcNBF9gF8gOB0Z2HeZdfLqE9uDgdzC46V1Aa6g S+5KtgJ+4KPjAEDUGO6DKj2FkIqx1roD3g56z56/APJMkoBJU8T/8lQLTrwpeahrDBzP55c1khSuo WE5aUK5ELeoDcQPo9qOh+s3vok/HYoxbT9gUrYk6FyVb5baCCQjTii446Tz57dE91gw+FWqr3B0YY 7DzwclfUBhNY88751AsXNCMbRP+hl//FBMqE+dkRJ1DRC2wWKq994Pb0vCVLdnisJralEi2i8YPnG lSMeoenQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hqJpZ-0000Rp-EL; Wed, 24 Jul 2019 16:09:29 +0000 Date: Wed, 24 Jul 2019 09:09:29 -0700 From: Christoph Hellwig To: Bharath Vedartham Cc: sivanich@sgi.com, arnd@arndb.de, jhubbard@nvidia.com, ira.weiny@intel.com, jglisse@redhat.com, gregkh@linuxfoundation.org, william.kucharski@oracle.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 3/3] sgi-gru: Use __get_user_pages_fast in atomic_pte_lookup Message-ID: <20190724160929.GA14052@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I think the atomic_pte_lookup / non_atomic_pte_lookup helpers should simply go away. Most of the setup code is common now and should be in the caller where it can be shared. Then just do a: if (atomic) { __get_user_pages_fast() } else { get_user_pages_fast(); } and we actually have an easy to understand piece of code.