Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8354358ybi; Tue, 23 Jul 2019 07:10:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwI0VvcbGjHUmdoZGHQxrsHlQ7B/jFJGa6vuZY39R66w5/jgj5cp5CoLzhbYwFOmYxFetsC X-Received: by 2002:a17:90b:94:: with SMTP id bb20mr83776376pjb.16.1563891054662; Tue, 23 Jul 2019 07:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563891054; cv=none; d=google.com; s=arc-20160816; b=Heb5GoolI7OMdJNLMWVBhQms7tr/i0eusP8swsWmOtiJw1PAvHDFoMl9nXIpi66SnY YjHOOCVnabAz43CFKgUC63rpZrz3onQbcFMbp3lFccyVkfa3SOkHLSXHiUFJuzF1BTUc gqpeAxzqk35AT0G6zfIPahNCni+rpKPgNs7nLHELmlqT4i+WlIaj7DMdegGM4WVcSKvS r7lHKepwRr+t/98LhU6SkbRFi575LpUKt3ssGdOWOs5kkJgGKPVwYNyg4qfFq+jqU7si KdrliwUDI1x6oS/O0LTDfo85Vb/4OsqkRrdsGdvRdxoA16hdGH5fKOPE8ajShOMsVW0p Ry+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8WRK6h6Cnn/rOW/4+Tb5umxeSX9AyCd6rpz5lA82//Q=; b=m04rJ5qlfw4KYa9GEznjrKT2qxmHKiV1n4WWcwdArZ4dtWHsmp+0n8juINDRx9Ys3k b1fKHj+YDv11Fs6hEBt2/ubtnVsbu8BkZKIBuzmv5MsYx8ImNl4oVjxA5Hgs6pDju/0W TLOY5y2G9tLELZWfJfcTOw4r+HYj+GKx00plfeGAP5Rhpa3mQvvsUCdAIlrWsaC9nDIv +14YOep9wZeZ0F6LAjIVBLZ/3lddkTBpwIvPCLjytciZdynt++pLQsctdw1gR6ZwjjBr VaiMFuNcV11d0dSm5fPzpuzvJaYgfOQbk/AlMXuh4Pokce82O3prEL4n0nzqf1CEZtaz QhWQ== ARC-Authentication-Results: i=1; mx.google.com; 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 z2si11019933pgv.417.2019.07.23.07.10.38; Tue, 23 Jul 2019 07:10: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; 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 S1729700AbfGWFyH (ORCPT + 99 others); Tue, 23 Jul 2019 01:54:07 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.