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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 4394AC76194 for ; Tue, 23 Jul 2019 05:54:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C87B2238E for ; Tue, 23 Jul 2019 05:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732852AbfGWFyG (ORCPT ); Tue, 23 Jul 2019 01:54:06 -0400 Received: from verein.lst.de ([213.95.11.211]:38712 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbfGWFyE (ORCPT ); Tue, 23 Jul 2019 01:54:04 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 3D38F68B20; Tue, 23 Jul 2019 07:53:59 +0200 (CEST) Date: Tue, 23 Jul 2019 07:53:59 +0200 From: Christoph Hellwig To: john.hubbard@gmail.com Cc: Andrew Morton , Alexander Viro , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Boaz Harrosh , Christoph Hellwig , Daniel Vetter , Dan Williams , Dave Chinner , David Airlie , "David S . Miller" , Ilya Dryomov , Jan Kara , Jason Gunthorpe , Jens Axboe , =?iso-8859-1?B?Suly9G1l?= Glisse , Johannes Thumshirn , Magnus Karlsson , Matthew Wilcox , Miklos Szeredi , Ming Lei , Sage Weil , Santosh Shilimkar , Yan Zheng , netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, LKML , John Hubbard Subject: Re: [PATCH 1/3] mm/gup: introduce __put_user_pages() Message-ID: <20190723055359.GC17148@lst.de> References: <20190722223415.13269-1-jhubbard@nvidia.com> <20190722223415.13269-2-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190722223415.13269-2-jhubbard@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Jul 22, 2019 at 03:34:13PM -0700, john.hubbard@gmail.com wrote: > +enum pup_flags_t { > + PUP_FLAGS_CLEAN = 0, > + PUP_FLAGS_DIRTY = 1, > + PUP_FLAGS_LOCK = 2, > + PUP_FLAGS_DIRTY_LOCK = 3, > +}; Well, the enum defeats the ease of just being able to pass a boolean expression to the function, which would simplify a lot of the caller, so if we need to support the !locked version I'd rather see that as a separate helper. But do we actually have callers where not using the _lock version is not a bug? set_page_dirty makes sense in the context of a file systems that have a reference to the inode the page hangs off, but that is (almost?) never the case for get_user_pages.