From nobody Mon Aug 7 01:00:20 2023 X-Original-To: dev-commits-src-main@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 4RJyfY0ZCrz4pk8Z; Mon, 7 Aug 2023 01:00:21 +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 4RJyfX6WzHz3Y5t; Mon, 7 Aug 2023 01:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691370020; 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=v+17hKKygByMtTqZIOTI0/JAxwlITEHlAaJi6f4zaYk=; b=sP6NwFwd3SOkgGlyeHdzYaifC9Wg01NzijIuzCkMT64SA448TDd0KIsbNPCIMflLlrpIxe YQQz6VsXrIUmLPUzh4BgrUUw6wIR1MwQ/AEM2HVU9fYplhErOPqC9eUyRdZ4KxXxKtnoHk hvJz/XVM4zdVb53Om6aCGjPeBN3HARe/vcHR+zp5RtmR/wxonDupxv9gwOkhhCDw6UondA a3ax6nHiouefTuQ19RvXGm62ghRyVmJQkEsddSq+HCePdMJI9WP5QueobqXRdHHxuRn+R2 ZdVvlhKSxx6xG4MbBTr8YnSyRlPKYBh2Kvd2/bJcLbmFC9hf4DcyHVuRefv8Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691370020; 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=v+17hKKygByMtTqZIOTI0/JAxwlITEHlAaJi6f4zaYk=; b=actpMhao98YyG9fEji67SRG0PSt4TqlGpBhAkGRry3pQm/qlVJpKlK9j25xm2YqlViF5wl ElZ15vw/tCSkBHUMd/bizCivrFltOpi2/E2/y0Lv3Gw+WVmQqoSKO9IUaEZjyB7HE+K8Vu p9yfjHZqClbkxjHIM7o/HX7jlByTdy9c8mO3KhouMb2VZx3r7NBpN6KdEiH3X7njGKUKHx 2eTyIbhQa62hVqmUTxJ2g4iivyV9fykEGppENuVZG53JVtROduXjRDKdneh3oMN4L/FMsg DMwrmMqOZF3vDMXOR5hjtHyEsmapiyNOeP7MpxDokgbAXfGB8nDkR/gSWp5Q/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691370020; a=rsa-sha256; cv=none; b=IrJoKiWjslPFwWlqNR0jLoGxnFFhcWnz/89hxcYc9G3RCmngQZD0/RhLSDNwh6X5PCpaEP KeHFVsEMO/eSkE6+ZgjSgmTr3baSuMDeOOwQ5krz2/nsNU1x1bzhYKhwR+OGSZ6ZIuTX6/ RAUh+hJavpiHEFpU8V6+SKIglohZe7SyKZEv2tWX5CrnO5xAiGMgDftCu6TcrPir8OmGVM xLOjks9I7OMYYV2IrVP1IsoRxIeDtZfWux6TrjATH5G4mMnwbti962nltWTKN7aro2i62y JvxzTbtXuBSuELNupN8F/rwXHpeTaHAXUUGpOFeOlZcKzbisa1qTmgCvzwFi7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RJyfX4zW7zXYn; Mon, 7 Aug 2023 01:00:20 +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 37710K23087050; Mon, 7 Aug 2023 01:00:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37710K1C087049; Mon, 7 Aug 2023 01:00:20 GMT (envelope-from git) Date: Mon, 7 Aug 2023 01:00:20 GMT Message-Id: <202308070100.37710K1C087049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9e9c682ff3a1 - main - LinuxKPI: reduce usage of struct vm_page and vm_page_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 9e9c682ff3a1aec20a7e5f5b1dd88ceaec7c3950 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9e9c682ff3a1aec20a7e5f5b1dd88ceaec7c3950 commit 9e9c682ff3a1aec20a7e5f5b1dd88ceaec7c3950 Author: Bjoern A. Zeeb AuthorDate: 2023-07-31 02:03:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-08-07 00:55:30 +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 MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D41255 --- 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 55558500dd30..9e6d3a665869 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -99,8 +99,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 8dab5b9daa76..00d102b6af4b 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -248,19 +248,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); } @@ -307,7 +307,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); } @@ -323,7 +323,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 6fcf9373a2f5..0cb724ebf6c4 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -98,10 +98,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; @@ -148,7 +148,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 741bb20c1aab..6ae11e8ef57e 100644 --- a/sys/compat/linuxkpi/common/src/linux_shmemfs.c +++ b/sys/compat/linuxkpi/common/src/linux_shmemfs.c @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); 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)