From nobody Wed Nov 29 16:37:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SgQ3l43kzz52wtc; Wed, 29 Nov 2023 16:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SgQ3l3FFpz3GQv; Wed, 29 Nov 2023 16:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HZxa0iY5C4DvMnyjmJmlaunmMr0ciAzXPuiTj+MKRQI=; b=X7DKyRpfndtU0pIeu8+gI3dnOSf9QBTtLISB9IgUyqZWJvWECj/kOXXdI1ttIVA4imH/lt /FkGuITmRBSITPECJrzSgvp0wyBhosaUM28Hueb3D6xgZ06JTWKk54rvmZhDSwX7JJZW1X jlNCkOm1K3vJHxYRE7WmrLSkBe/tm1au+BU3NWph1BlUj28VCgSS2KnlMX/UpgxfGgE0st XSpAI7P+IG99RXGl+SKZSDYlP890FYwjMoyDeOe67hA3Z3mtO6s1gfHeUJTzb2eBjvOcio yWeNsfM4MaxiQQBv1h1zNbSfqN+NVevdpH+hhYxjAKP17b/cyF1DpATNEgK7ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HZxa0iY5C4DvMnyjmJmlaunmMr0ciAzXPuiTj+MKRQI=; b=eIYrnIxtzuLSV4KR49vPSNSTtJFxWtWWjFhzfDmYvnRBQMZ/lHG0DZyBnqXE153uAjDz6f 1VWn7YAOHLA4jwiUypY/kkkbZt/61m3PAenWNZ2hPI2gwNWIcHVaYiBtSZ9bSXMXiRmM4I 43M2/cVt+qx1ZOANjNeD+EMKHccZsXMgxArPWciS6JEQ8D8XENzu6nYrr3VGgmV1Fr8j1g yc5fgWHOpphPsHSrnObZtlDbcBi5fuX+tdVvyHzrlc4Skss8HYgZz7SyQ6plwwmkqEiOzI WNoq1Z5YxfC3Zf+WbQ0+tG5Z2QGLv4yG6oTHHgRN3n4yDMCP/5ueD/pBEPLxlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701275875; a=rsa-sha256; cv=none; b=RmCoEz1/gzlfdae2YsVTBmuCBlL03llP6FlJc+/nkMiX8SqEpTP7VlxryNel/Hs3SnHYfd 6tnB5g5ouCueYTMObBQFKoUjHteD7RSJy7pyrHakoo1vjD95e1hNyCRGZu+V1r2KA7K4wW cSfaRSFRZlfzSrtMnJS12z9ZiAEpr4sFR/QCL4/IldNT8JSvuiSFtEyA/wpk+H8KVvgXQX ylYW8f/bIDv1CUMYgX8sAhUDhcoiV46Fzekit2OiIy62cS1p/MOIr/xAirfoixz9o4gNEt GgO0nw0lUUvJHbmY7dfZ+39bbbxXTlOqt+Lwr6AGq+tJU98e1wDo+zSJH7m4FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SgQ3l2Jwqz1C2C; Wed, 29 Nov 2023 16:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3ATGbtub044486; Wed, 29 Nov 2023 16:37:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ATGbtgY044483; Wed, 29 Nov 2023 16:37:55 GMT (envelope-from git) Date: Wed, 29 Nov 2023 16:37:55 GMT Message-Id: <202311291637.3ATGbtgY044483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9d41057c94bc - stable/13 - LinuxKPI: reduce usage of struct vm_page and vm_page_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d41057c94bcbdae8c7b8c9e8a064352da6fccbd Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9d41057c94bcbdae8c7b8c9e8a064352da6fccbd commit 9d41057c94bcbdae8c7b8c9e8a064352da6fccbd Author: Bjoern A. Zeeb AuthorDate: 2023-07-31 02:03:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-29 16:36:04 +0000 LinuxKPI: reduce usage of struct vm_page and vm_page_t We currently define (Linux) page to (FreeBSD) vm_page. Cleanup some of the direct struct vm_page and vm_page_t declarations and usages in the Linux KPI and make them 'struct page' or 'struct page *' to prepare for more upcoming work. This should be a NOP. Sponsored by: The FreeBSD Foundation (cherry picked from commit 9e9c682ff3a1aec20a7e5f5b1dd88ceaec7c3950) --- sys/compat/linuxkpi/common/include/asm/set_memory.h | 12 ++++++------ sys/compat/linuxkpi/common/include/linux/gfp.h | 4 ++-- sys/compat/linuxkpi/common/include/linux/highmem.h | 12 ++++++------ sys/compat/linuxkpi/common/include/linux/mm.h | 10 +++++----- sys/compat/linuxkpi/common/include/linux/pagevec.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_page.c | 6 +++--- sys/compat/linuxkpi/common/src/linux_shmemfs.c | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/asm/set_memory.h b/sys/compat/linuxkpi/common/include/asm/set_memory.h index cdb7ad912acc..ae50148f0314 100644 --- a/sys/compat/linuxkpi/common/include/asm/set_memory.h +++ b/sys/compat/linuxkpi/common/include/asm/set_memory.h @@ -54,7 +54,7 @@ set_memory_wb(unsigned long addr, int numpages) } static inline int -set_pages_uc(vm_page_t page, int numpages) +set_pages_uc(struct page *page, int numpages) { KASSERT(numpages == 1, ("%s: numpages %d", __func__, numpages)); @@ -63,7 +63,7 @@ set_pages_uc(vm_page_t page, int numpages) } static inline int -set_pages_wc(vm_page_t page, int numpages) +set_pages_wc(struct page *page, int numpages) { KASSERT(numpages == 1, ("%s: numpages %d", __func__, numpages)); @@ -76,7 +76,7 @@ set_pages_wc(vm_page_t page, int numpages) } static inline int -set_pages_wb(vm_page_t page, int numpages) +set_pages_wb(struct page *page, int numpages) { KASSERT(numpages == 1, ("%s: numpages %d", __func__, numpages)); @@ -85,7 +85,7 @@ set_pages_wb(vm_page_t page, int numpages) } static inline int -set_pages_array_wb(vm_page_t *pages, int addrinarray) +set_pages_array_wb(struct page **pages, int addrinarray) { int i; @@ -95,7 +95,7 @@ set_pages_array_wb(vm_page_t *pages, int addrinarray) } static inline int -set_pages_array_wc(vm_page_t *pages, int addrinarray) +set_pages_array_wc(struct page **pages, int addrinarray) { int i; @@ -105,7 +105,7 @@ set_pages_array_wc(vm_page_t *pages, int addrinarray) } static inline int -set_pages_array_uc(vm_page_t *pages, int addrinarray) +set_pages_array_uc(struct page **pages, int addrinarray) { int i; diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h index 70c486002335..c5de09e896de 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -97,8 +97,8 @@ extern void *linux_page_address(struct page *); /* * Page management for unmapped pages: */ -extern vm_page_t linux_alloc_pages(gfp_t flags, unsigned int order); -extern void linux_free_pages(vm_page_t page, unsigned int order); +extern struct page *linux_alloc_pages(gfp_t flags, unsigned int order); +extern void linux_free_pages(struct page *page, unsigned int order); void *linuxkpi_page_frag_alloc(struct page_frag_cache *, size_t, gfp_t); void linuxkpi_page_frag_free(void *); void linuxkpi__page_frag_cache_drain(struct page *, size_t); diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h index 1c2c97e03578..a3f9af82400e 100644 --- a/sys/compat/linuxkpi/common/include/linux/highmem.h +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -47,7 +47,7 @@ #define PageHighMem(p) (0) -static inline vm_page_t +static inline struct page * kmap_to_page(void *addr) { @@ -55,7 +55,7 @@ kmap_to_page(void *addr) } static inline void * -kmap(vm_page_t page) +kmap(struct page *page) { struct sf_buf *sf; @@ -73,7 +73,7 @@ kmap(vm_page_t page) } static inline void * -kmap_atomic_prot(vm_page_t page, pgprot_t prot) +kmap_atomic_prot(struct page *page, pgprot_t prot) { vm_memattr_t attr = pgprot2cachemode(prot); @@ -87,21 +87,21 @@ kmap_atomic_prot(vm_page_t page, pgprot_t prot) } static inline void * -kmap_atomic(vm_page_t page) +kmap_atomic(struct page *page) { return (kmap_atomic_prot(page, VM_PROT_ALL)); } static inline void * -kmap_local_page_prot(vm_page_t page, pgprot_t prot) +kmap_local_page_prot(struct page *page, pgprot_t prot) { return (kmap_atomic_prot(page, prot)); } static inline void -kunmap(vm_page_t page) +kunmap(struct page *page) { struct sf_buf *sf; diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index ce3c94ee64aa..3d826f73a494 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -246,19 +246,19 @@ vma_pages(struct vm_area_struct *vma) #define offset_in_page(off) ((unsigned long)(off) & (PAGE_SIZE - 1)) static inline void -set_page_dirty(struct vm_page *page) +set_page_dirty(struct page *page) { vm_page_dirty(page); } static inline void -mark_page_accessed(struct vm_page *page) +mark_page_accessed(struct page *page) { vm_page_reference(page); } static inline void -get_page(struct vm_page *page) +get_page(struct page *page) { vm_page_wire(page); } @@ -305,7 +305,7 @@ pin_user_pages_remote(struct task_struct *task, struct mm_struct *mm, } static inline void -put_page(struct vm_page *page) +put_page(struct page *page) { vm_page_unwire(page, PQ_ACTIVE); } @@ -321,7 +321,7 @@ vm_get_page_prot(unsigned long vm_flags) return (vm_flags & VM_PROT_ALL); } -static inline vm_page_t +static inline struct page * vmalloc_to_page(const void *addr) { vm_paddr_t paddr; diff --git a/sys/compat/linuxkpi/common/include/linux/pagevec.h b/sys/compat/linuxkpi/common/include/linux/pagevec.h index 4224124c4fe4..9ba8ff8effa0 100644 --- a/sys/compat/linuxkpi/common/include/linux/pagevec.h +++ b/sys/compat/linuxkpi/common/include/linux/pagevec.h @@ -13,7 +13,7 @@ struct pagevec { uint8_t nr; - struct vm_page *pages[PAGEVEC_SIZE]; + struct page *pages[PAGEVEC_SIZE]; }; static inline unsigned int @@ -41,7 +41,7 @@ pagevec_count(struct pagevec *pvec) } static inline unsigned int -pagevec_add(struct pagevec *pvec, struct vm_page *page) +pagevec_add(struct pagevec *pvec, struct page *page) { pvec->pages[pvec->nr++] = page; return PAGEVEC_SIZE - pvec->nr; diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index 41e4989c397c..ca2f6a8e6d08 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -96,10 +96,10 @@ linux_page_address(struct page *page) IDX_TO_OFF(page->pindex))); } -vm_page_t +struct page * linux_alloc_pages(gfp_t flags, unsigned int order) { - vm_page_t page; + struct page *page; if (PMAP_HAS_DMAP) { unsigned long npages = 1UL << order; @@ -146,7 +146,7 @@ linux_alloc_pages(gfp_t flags, unsigned int order) } void -linux_free_pages(vm_page_t page, unsigned int order) +linux_free_pages(struct page *page, unsigned int order) { if (PMAP_HAS_DMAP) { unsigned long npages = 1UL << order; diff --git a/sys/compat/linuxkpi/common/src/linux_shmemfs.c b/sys/compat/linuxkpi/common/src/linux_shmemfs.c index 0ebbd34d067d..3c71d6495f4a 100644 --- a/sys/compat/linuxkpi/common/src/linux_shmemfs.c +++ b/sys/compat/linuxkpi/common/src/linux_shmemfs.c @@ -45,7 +45,7 @@ struct page * linux_shmem_read_mapping_page_gfp(vm_object_t obj, int pindex, gfp_t gfp) { - vm_page_t page; + struct page *page; int rv; if ((gfp & GFP_NOWAIT) != 0)