Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2503161rwb; Mon, 7 Nov 2022 14:12:07 -0800 (PST) X-Google-Smtp-Source: AMsMyM5f2JkiUwBBDWRe35rFOIfZc0F4jqFRoJUVMAMQfRLvNp5oGWyGp4oOvN1rizp/bW4hCxYY X-Received: by 2002:a17:90a:1a44:b0:215:d520:f5a1 with SMTP id 4-20020a17090a1a4400b00215d520f5a1mr28850890pjl.182.1667859127369; Mon, 07 Nov 2022 14:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667859127; cv=none; d=google.com; s=arc-20160816; b=Vt+EbDlD1nJEHzM11VAgQw1n2ZX2PGk5BaPf+DZPOPuiiB5Dqyb8cPjFqwyNvPnhC0 KVRxaeZ2M+V81b+GBrbTHbdTHJ+kLB13YtqOJXoLoTTZ52zMNlA2O/aDqwQWbkczkccO Ilek7zmtbGR2VG5fkAp88QyX9AOZIyDpfBBL4V1PondCdOSQ6xegfwwSjefa5RNW3Ip5 KeS9DJ68aIwLPbLMVu+MsRYrDlqRFLmxuVaVORK857oBTszUqKsucjVDif88S88XtJ9u A0c3Spo3nVzKg8Wccvub8VzdksyA8j7ZBCtHrIc+mSF57LbfxmSpqkCIaWyT968Ld4zT +oJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=LZjiXUKF7GeG+TMZVO7Yb+tBaMiIUJ8KN3qkDcEDN4A=; b=B2314Q4qKSK0ELtxwFqRXt3t2B6/xQx4LJk7Xii94fYHC9aJZiggRyr7ye2pjta3PB kwcxFAOMNYIroyQ/A9izGHo7bV+vrRhfOdHPsIqscYuYoWYJQDvKCXMORqosCOVKlGko asp0+RwYMJBM9XKIkg7FtKXhmDWFObqRQLgsCb1N5OXYhAXGAqig8wv+xXX3+gV0nYGA nP/Ybe2A1KcjuEMKGFGQK36TG/BycN7TWUlDMfxbJGYFXMsv3rXZilbPuaJ/Q9h6zcvK wN4rCGTQJj+3f1oIuCa9PkdALCay2AEEyEDUtrN60NY4YhMZ2jyI0JWnVueDEi7FI/6O 2lgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ffvHIqoj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pj12-20020a17090b4f4c00b00213bbb6751asi13039714pjb.112.2022.11.07.14.11.55; Mon, 07 Nov 2022 14:12:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ffvHIqoj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231598AbiKGV0S (ORCPT + 91 others); Mon, 7 Nov 2022 16:26:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233106AbiKGV0H (ORCPT ); Mon, 7 Nov 2022 16:26:07 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7011FDE5; Mon, 7 Nov 2022 13:26:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 681A7CE1836; Mon, 7 Nov 2022 21:26:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9495CC43146; Mon, 7 Nov 2022 21:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667856362; bh=SwQyXyRosovtBDcr7GfPt6fsp4ng05oq/t3fG7dB68g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ffvHIqojBVLH/R8RQOQEgXCeTITmfwvIoxefm2/kBiEz2OyLI9Io4TDxW06ogg/sN 3fWSVwLP7C1LXRhdThBd1UCmwrb62aNwnwPhsnjD194IsHOpRrxOtn/gP3z8BLEjEE 3a6gLv9bTBbYeKfi6puWXH9+gHFk4yKiM4mbbf1kJMaVXq4O7YS4IPezgSwqAiw6dg aWWwBH05mwWpElBiERd2AjzW1oA4IQ2N8kMYhhPV076879Sxylya1gjvFB6S75Ki6D YSxGBZQ+IsbaVRLSlTBJcnreOKfX2foV+YDEFOPtCI4Hb73C8fJ5KP2ecXZ+zVPCe3 Yxz5zRAEx0Q+g== Received: by mail-yb1-f169.google.com with SMTP id j130so15158729ybj.9; Mon, 07 Nov 2022 13:26:02 -0800 (PST) X-Gm-Message-State: ANoB5plSB68OZ+YlugLT+B1aiH52aXAGrNy8amNPjlBov+mnscikxPu8 hKgdN9sUOuKN+ilwdyRBIeHLJrKlJ4LFVTU5tAs= X-Received: by 2002:a25:2389:0:b0:6d8:7f81:edaf with SMTP id j131-20020a252389000000b006d87f81edafmr3849061ybj.443.1667856361598; Mon, 07 Nov 2022 13:26:01 -0800 (PST) MIME-Version: 1.0 References: <20221107161740.144456-1-david@redhat.com> <20221107161740.144456-20-david@redhat.com> In-Reply-To: <20221107161740.144456-20-david@redhat.com> From: Oded Gabbay Date: Mon, 7 Nov 2022 23:25:35 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 19/19] habanalabs: remove FOLL_FORCE usage To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-kselftest@vger.kernel.org, Linus Torvalds , Andrew Morton , Jason Gunthorpe , John Hubbard , Peter Xu , Greg Kroah-Hartman , Andrea Arcangeli , Hugh Dickins , Nadav Amit , Vlastimil Babka , Matthew Wilcox , Mike Kravetz , Muchun Song , Lucas Stach , David Airlie , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 7, 2022 at 6:19 PM David Hildenbrand wrote: > > FOLL_FORCE is really only for debugger access. As we unpin the pinned pages > using unpin_user_pages_dirty_lock(true), the assumption is that all these > pages are writable. > > FOLL_FORCE in this case seems to be due to copy-and-past from other > drivers. Let's just remove it. > > Cc: Oded Gabbay > Cc: Arnd Bergmann > Cc: Greg Kroah-Hartman > Signed-off-by: David Hildenbrand > --- > drivers/misc/habanalabs/common/memory.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c > index ef28f3b37b93..e35cca96bbef 100644 > --- a/drivers/misc/habanalabs/common/memory.c > +++ b/drivers/misc/habanalabs/common/memory.c > @@ -2312,8 +2312,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size, > if (!userptr->pages) > return -ENOMEM; > > - rc = pin_user_pages_fast(start, npages, > - FOLL_FORCE | FOLL_WRITE | FOLL_LONGTERM, > + rc = pin_user_pages_fast(start, npages, FOLL_WRITE | FOLL_LONGTERM, > userptr->pages); > > if (rc != npages) { > -- > 2.38.1 > > Acked-by: Oded Gabbay Thanks, Oded