Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3003735ybk; Mon, 18 May 2020 13:19:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZeeIDNYdPTso7vdudL8ILcdZkBBRuikrfx9ldLb5YV4E22o5EUW3KoTcQUSvM2F+EQfla X-Received: by 2002:a05:6402:1855:: with SMTP id v21mr15746901edy.189.1589833184564; Mon, 18 May 2020 13:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589833184; cv=none; d=google.com; s=arc-20160816; b=NGwNdTZ3Nawf2ag82XmHmkFvTHnH914tT4ZiKC5QNJ4Gr3Xrh/kbmauzwYhuYOAUfb 7CHgmsN+3m6aGkPJ2preVm0gAyHr7BsMIqrEeL3bW903tA+qXSJ3Y+DISpMTtv39mSvR j3KcoGEMeO36BQ0qQknxWEr14DaMb4tWEe+ZdhK7agg8Telymh1hdDvsTlW1CxQ8w+uR uIXzXOakBb+0LFic8WEL93LVNYtBr4ubt49ZnB943Rlv0Sig7n0vAwRHfA3adAW61i+d vLiynFnX0PLfIjoBAk3Xy5bIP+BsxbbuZGuJz6uoTzJV1rdkkqKIG7cEPfETcdrT6FJA E1YA== 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=Tmfw6jv5c7I6nXp+B8iQMsgCtcPbXu8jo3om/FY1qFw=; b=SgIdCfL6XvY2ukF3udW3/rg3hnyXWManFsJVhhuvH7x0NAbTEZ6h3oNpN2byIQ/HMR lbZqFihkzyFekY6YH5+WUtWMwssGwUGwsP8jtTGgX24O3bBG+EqK/pmAb3G00qqfFFke HtDBAfKb6J170QSkg9ht5ihbYTyUQIgd9uyKQkKAG/TGaD4pBAhjQyYQJkzF9w/6fy6H 5ZnniW6mdwppsBG/OXe9B/8nJkLKXacrBIJhikrpK2mJ8Biybepw7oe7nr/IxhbENmZ4 M+XOMp8XbZOKRpfkjBrX4kMENR2NwYNq+3P/mVzQh4R9Aoof54o2/fpIm+Z5xEriSjQO 6Gtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SaXIVd6V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r16si7166743edp.57.2020.05.18.13.19.22; Mon, 18 May 2020 13:19:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SaXIVd6V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727076AbgERURm (ORCPT + 99 others); Mon, 18 May 2020 16:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726367AbgERURm (ORCPT ); Mon, 18 May 2020 16:17:42 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B1B1C061A0C for ; Mon, 18 May 2020 13:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Tmfw6jv5c7I6nXp+B8iQMsgCtcPbXu8jo3om/FY1qFw=; b=SaXIVd6VivCdptFJVGlmWC8fzO Jx5YkkPhHKxbCKDyIvWNZndS6WIHBY41YhddYvOORXpZjVNSB9fZ4k0cO4itdlqeetvBqSwQTDqWA VGr3iSBcmHogXbbEh94LhIxMxonmwgetSILAc8bqM0WdlaOAl3S6OtrZyzAgzOaQGoZuR94WCmiCt PA+2xjYxgxbZyZd8d9HUY2eptNIceu74Y7YcM+KILfayp/FCkxSE0Rt9rb4wqMQUzah7umJqXwadI YA0vRnQcws0drKfTegKLFC9sc6aAKLbxa7CVJ42s/dha303uuMCvnIJOc2WZvN9YlYSpQ26Ur6G2Z fpW7w//w==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jamCf-000670-KU; Mon, 18 May 2020 20:17:37 +0000 Date: Mon, 18 May 2020 13:17:37 -0700 From: Matthew Wilcox To: Souptick Joarder Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] mm/gup.c: Use gup_flags as parameter instead of passing write flag Message-ID: <20200518201737.GV16070@bombadil.infradead.org> References: <1589831903-27800-1-git-send-email-jrdr.linux@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589831903-27800-1-git-send-email-jrdr.linux@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 01:28:23AM +0530, Souptick Joarder wrote: > The idea is to get rid of write parameter. Instead caller will pass > FOLL_WRITE to __get_user_pages_fast(). This will not change any > functionality of the API. Once it is upstream all the callers will > be changed to pass FOLL_WRITE. Uhh ... until you change all the callers, haven't you just broken all the callers? > -int __get_user_pages_fast(unsigned long start, int nr_pages, int write, > - struct page **pages) > +int __get_user_pages_fast(unsigned long start, int nr_pages, > + unsigned int gup_flags, struct page **pages) > { > unsigned long len, end; > unsigned long flags; > @@ -2685,10 +2692,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, > * Internally (within mm/gup.c), gup fast variants must set FOLL_GET, > * because gup fast is always a "pin with a +1 page refcount" request. > */ > - unsigned int gup_flags = FOLL_GET; > - > - if (write) > - gup_flags |= FOLL_WRITE; > + gup_flags |= FOLL_GET;