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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 B6285C433B4 for ; Mon, 12 Apr 2021 09:19:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CF3861207 for ; Mon, 12 Apr 2021 09:19:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CF3861207 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CEE36E3BB; Mon, 12 Apr 2021 09:19:04 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FA5D6E3BB for ; Mon, 12 Apr 2021 09:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=LbLEaQQn1m2iX7nE7PPEHGSV/YwnfR4XbHyT4vIPCOo=; b=Y7cOtXpfBCuSpO+OG8inZmByp2 uC4BQykiuxpyWwj9PEbqBrYmAomUef+mOvq9II+Bgwq1Wx4i9lqPwFP5iR1rQXCrraYmh+eDlZ4CT 1Zhb2CFA6iX27CPaSKYYah/i6G3/iYOyevF+6LmNHtO4UY+7nqUwnKMHbwY/G3cXZNddMvKSh/rFU fmJXSb7O6QXojSUBpWgdKineQsozxBH+82N4Q5tYFD/qBX8rSSSJWTnaKalsYRWilBjglVWMVfkcR ywqTSgpLtVW5l2+baf/9yWnxmsIXNookZXXlEISRyNz6wkQ0irLAYcD3XvMUXzyeLoGChfhrG4gw4 XZdoU4Vg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lVshP-0044xV-Eb; Mon, 12 Apr 2021 09:17:41 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1D49D300033; Mon, 12 Apr 2021 11:17:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D543020224206; Mon, 12 Apr 2021 11:17:36 +0200 (CEST) Date: Mon, 12 Apr 2021 11:17:36 +0200 From: Peter Zijlstra To: Christoph Hellwig Message-ID: References: <20210412080012.357146277@infradead.org> <20210412080611.769864829@infradead.org> <20210412082805.GD4372@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210412082805.GD4372@lst.de> Subject: Re: [Intel-gfx] [PATCH 4/7] mm: Introduce verify_page_range() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jgross@suse.com, sstabellini@kernel.org, keescook@chromium.org, intel-gfx@lists.freedesktop.org, x86@kernel.org, linux-kernel@vger.kernel.org, chris@chris-wilson.co.uk, linux-mm@kvack.org, boris.ostrovsky@oracle.com, akpm@linux-foundation.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, Apr 12, 2021 at 10:28:05AM +0200, Christoph Hellwig wrote: > On Mon, Apr 12, 2021 at 10:00:16AM +0200, Peter Zijlstra wrote: > > +extern int verify_page_range(struct mm_struct *mm, > > No need for the extern here. It's consistent with the rest of the functions there. Also, I personally like that extern. > > +int verify_page_range(struct mm_struct *mm, > > + unsigned long addr, unsigned long size, > > + int (*fn)(pte_t pte, unsigned long addr, void *data), > > + void *data) > > A kerneldoc comment would be nice for this function. > > Otherwise this looks fine. Something like so? /** * verify_page_range() - Scan (and fill) a range of virtual memory and validate PTEs * @mm: mm identifying the virtual memory map * @addr: starting virtual address of the range * @size: size of the range * @fn: function that verifies the PTEs * @data: opaque data passed to @fn * * Scan a region of virtual memory, filling in page tables as necessary and * calling a provided function on each leaf, providing a copy of the * page-table-entry. * * Similar apply_to_page_range(), but does not provide direct access to the * page-tables. * * NOTE! this function does not work correctly vs large pages. * * Return: the first !0 return of the provided function, or 0 on completion. */ int verify_page_range(struct mm_struct *mm, unsigned long addr, unsigned long size, int (*fn)(pte_t pte, unsigned long addr, void *data), void *data) _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx