Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1191633
| From | David Vrabel <david.vrabel@citrix.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [Xen-devel] [PATCH v2 02/20] xen: Introduce a function to split a Linux page into Xen page |
| Date | 2015-07-24 11:40 +0200 |
| Message-ID | <pPHCs-1Ol-31@gated-at.bofh.it> (permalink) |
| References | <pKqVz-4Ye-3@gated-at.bofh.it> <pKqVB-4Ye-47@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 09/07/15 21:42, Julien Grall wrote:
> The Xen interface is always using 4KB page. This means that a Linux page
> may be split across multiple Xen page when the page granularity is not
> the same.
>
> This helper will break down a Linux page into 4KB chunk and call the
> helper on each of them.
[...]
> --- a/include/xen/page.h
> +++ b/include/xen/page.h
> @@ -39,4 +39,24 @@ struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS];
>
> extern unsigned long xen_released_pages;
>
> +typedef int (*xen_pfn_fn_t)(struct page *page, unsigned long pfn, void *data);
> +
> +/* Break down the page in 4KB granularity and call fn foreach xen pfn */
> +static inline int xen_apply_to_page(struct page *page, xen_pfn_fn_t fn,
> + void *data)
I think this should be outlined (unless you have measurements that
support making it inlined).
Also perhaps make it
int xen_for_each_gfn(struct page *page,
xen_gfn_fn_t fn, void *data);
or
int xen_for_each_gfn(struct page **page, unsigned int count,
xen_gfn_fn_t fn, void *data);
?
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [Xen-devel] [PATCH v2 02/20] xen: Introduce a function to split a Linux page into Xen page David Vrabel <david.vrabel@citrix.com> - 2015-07-24 11:40 +0200
Re: [Xen-devel] [PATCH v2 02/20] xen: Introduce a function to split a Linux page into Xen page Julien Grall <julien.grall@citrix.com> - 2015-07-24 12:00 +0200
Re: [Xen-devel] [PATCH v2 02/20] xen: Introduce a function to split a Linux page into Xen page David Vrabel <david.vrabel@citrix.com> - 2015-07-24 12:20 +0200
Re: [Xen-devel] [PATCH v2 02/20] xen: Introduce a function to split a Linux page into Xen page Julien Grall <julien.grall@citrix.com> - 2015-07-24 12:30 +0200
csiph-web