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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E8CBC433FE for ; Wed, 23 Nov 2022 13:26:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Subject:From:References:Cc: To:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DUznkrcwHs7dd/auP4Tozp9KbqmB5sMHlooaFtheTfg=; b=Dp0BuAmMf2KC9P 5yA7h1L5+MZm9Y54exjQSRQr6o+DSqDZSulVG+uWg5fHmCkDUZJKJqi5X9hl39ys6XXAhaGQUxSk2 iPAEMuxFQ7eYy1+4mHXpnJ6n0gBgaPWDTOTJ/qeTJH4rckeQw+BXezibpsohna1h4yh2pT8NnNOdR yqfJVcQSJhIIbjn8Yc7Iy2w27DAXCYvDJtIlSgISwvoLvoneBq07+w4+CMzfhGfJN32ySbOpkzuxJ 3hea+LX1+H1KzO1LwTT+22Zam42gXF97MHONhKgKbUrS5aAgI3aVHc+Zro+nwRR9GKHoEUGtL4WtP N7KseN4OuIARc4HM1qog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxplq-00HDcZ-Ai; Wed, 23 Nov 2022 13:26:34 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxple-00HDXv-74; Wed, 23 Nov 2022 13:26:23 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 394E2B81FC0; Wed, 23 Nov 2022 13:26:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB42CC433C1; Wed, 23 Nov 2022 13:26:11 +0000 (UTC) Message-ID: <36dd800b-d96b-af39-d0de-a5a8ca1034dd@xs4all.nl> Date: Wed, 23 Nov 2022 14:26:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Content-Language: en-US To: David Hildenbrand , Tomasz Figa Cc: x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-security-module@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 , Shuah Khan , Lucas Stach , David Airlie , Oded Gabbay , Arnd Bergmann , Christoph Hellwig , Alex Williamson , Marek Szyprowski , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org References: <20221116102659.70287-1-david@redhat.com> <20221116102659.70287-17-david@redhat.com> From: Hans Verkuil Subject: Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage In-Reply-To: <20221116102659.70287-17-david@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221123_052622_574404_563039F7 X-CRM114-Status: GOOD ( 25.25 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org Hi David, Tomasz, On 16/11/2022 11:26, David Hildenbrand wrote: > FOLL_FORCE is really only for ptrace access. According to commit > 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always > writable"), get_vaddr_frames() currently pins all pages writable as a > workaround for issues with read-only buffers. I've decided to revert 707947247e95: I have not been able to reproduce the problem described in that commit, and Tomasz reported that it caused problems with a specific use-case they encountered. I'll post that patch soon and I expect it to land in 6.2. It will cause a conflict with this patch, though. If the problem described in that patch occurs again, then I will revisit it and hopefully do a better job than I did before. That commit was not my finest moment. Regards, Hans > > FOLL_FORCE, however, seems to be a legacy leftover as it predates > commit 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are > always writable"). Let's just remove it. > > Once the read-only buffer issue has been resolved, FOLL_WRITE could > again be set depending on the DMA direction. > > Cc: Hans Verkuil > Cc: Marek Szyprowski > Cc: Tomasz Figa > Cc: Marek Szyprowski > Cc: Mauro Carvalho Chehab > Signed-off-by: David Hildenbrand > --- > drivers/media/common/videobuf2/frame_vector.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/common/videobuf2/frame_vector.c b/drivers/media/common/videobuf2/frame_vector.c > index 542dde9d2609..062e98148c53 100644 > --- a/drivers/media/common/videobuf2/frame_vector.c > +++ b/drivers/media/common/videobuf2/frame_vector.c > @@ -50,7 +50,7 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, > start = untagged_addr(start); > > ret = pin_user_pages_fast(start, nr_frames, > - FOLL_FORCE | FOLL_WRITE | FOLL_LONGTERM, > + FOLL_WRITE | FOLL_LONGTERM, > (struct page **)(vec->ptrs)); > if (ret > 0) { > vec->got_ref = true; _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um