search for: __get_free_page

Displaying 20 results from an estimated 79 matches for "__get_free_page".

Did you mean: __get_free_pages
2007 Apr 18
1
[PATCH 3/3] Gdt hotplug
...boot.c 2005-09-20 20:38:22.000000000 -0700 +++ linux-2.6.14-rc1/arch/i386/kernel/smpboot.c 2005-09-28 12:54:08.000000000 -0700 @@ -898,7 +898,8 @@ static int __devinit do_boot_cpu(int api * This grunge runs the startup process for * the targeted processor. */ - cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO); + if (!cpu_gdt_descr[cpu].address) + cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO); atomic_set(&init_deasserted, 0);
2007 Apr 18
1
[PATCH 3/3] Gdt hotplug
...boot.c 2005-09-20 20:38:22.000000000 -0700 +++ linux-2.6.14-rc1/arch/i386/kernel/smpboot.c 2005-09-28 12:54:08.000000000 -0700 @@ -898,7 +898,8 @@ static int __devinit do_boot_cpu(int api * This grunge runs the startup process for * the targeted processor. */ - cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO); + if (!cpu_gdt_descr[cpu].address) + cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO); atomic_set(&init_deasserted, 0);
2009 Apr 22
1
[PATCH 1/1] OCFS2: fasten dlm_lock_resource hash_table lookups
...vec, int pages) +{ + while (pages--) + free_page((unsigned long)vec[pages]); + kfree(vec); +} + +static void **dlm_alloc_pagevec(int pages) +{ + void **vec = kmalloc(pages * sizeof(void *), GFP_KERNEL); + int i; + + if (!vec) + return NULL; + + for (i = 0; i < pages; i++) { + vec[i] = (void *)__get_free_page(GFP_KERNEL); + if (!vec[i]) + goto out_free; + } + mlog(0, "Allocated DLM hash pagevec; %d pages (%lu expected), %Zd " + "buckets per page\n", pages, DLM_HASH_PAGES, DLM_BUCKETS_PER_PAGE); + return vec; +out_free: + dlm_free_pagevec(vec, i); + return NULL; +} + /* * o...
2007 Apr 18
2
[PATCH 3/3] Gdt page isolation
...boot.c 2005-09-20 20:19:57.000000000 -0700 +++ linux-2.6.14-rc1/arch/i386/kernel/smpboot.c 2005-09-20 20:38:22.000000000 -0700 @@ -898,6 +898,7 @@ static int __devinit do_boot_cpu(int api * This grunge runs the startup process for * the targeted processor. */ + cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO); atomic_set(&init_deasserted, 0); Index: linux-2.6.14-rc1/arch/i386/kernel/head.S =================================================================== --- linux-2.6.14-rc1.orig/arch/i386/kernel/head.S 2005-09-20 14:32:16.000000000 -0700 +++ linux-2.6.14-rc1/arch/i386...
2007 Apr 18
2
[PATCH 3/3] Gdt page isolation
...boot.c 2005-09-20 20:19:57.000000000 -0700 +++ linux-2.6.14-rc1/arch/i386/kernel/smpboot.c 2005-09-20 20:38:22.000000000 -0700 @@ -898,6 +898,7 @@ static int __devinit do_boot_cpu(int api * This grunge runs the startup process for * the targeted processor. */ + cpu_gdt_descr[cpu].address = __get_free_page(GFP_KERNEL|__GFP_ZERO); atomic_set(&init_deasserted, 0); Index: linux-2.6.14-rc1/arch/i386/kernel/head.S =================================================================== --- linux-2.6.14-rc1.orig/arch/i386/kernel/head.S 2005-09-20 14:32:16.000000000 -0700 +++ linux-2.6.14-rc1/arch/i386...
2009 May 01
0
[PATCH 1/3] OCFS2: speed up dlm_lockr_resouce hash_table lookups
...vec, int pages) +{ + while (pages--) + free_page((unsigned long)vec[pages]); + kfree(vec); +} + +static void **dlm_alloc_pagevec(int pages) +{ + void **vec = kmalloc(pages * sizeof(void *), GFP_KERNEL); + int i; + + if (!vec) + return NULL; + + for (i = 0; i < pages; i++) { + vec[i] = (void *)__get_free_page(GFP_KERNEL); + if (!vec[i]) + goto out_free; + } + return vec; +out_free: + dlm_free_pagevec(vec, i); + return NULL; + +} + /* * * spinlock lock ordering: if multiple locks are needed, obey this ordering: @@ -127,7 +154,7 @@ void __dlm_insert_lockres(struct dlm_ctx q = &res->lock...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...t size) *pc2 = '\0'; } -static ssize_t cfq_cgroup_read(struct cgroup *cont, struct cftype *cft, - struct file *file, char __user *userbuf, - size_t nbytes, loff_t *ppos) -{ - struct cfq_cgroup *cfqc; - char *page; - ssize_t ret; - struct rb_node *p; - - page = (char *)__get_free_page(GFP_TEMPORARY); - if (!page) - return -ENOMEM; - - cgroup_lock(); - if (cgroup_is_removed(cont)) { - cgroup_unlock(); - ret = -ENODEV; - goto out; - } - - cfqc = cgroup_to_cfq_cgroup(cont); - - cgroup_unlock(); - - /* print priority */ - ret = snprintf(page, PAGE_SIZE, "default priority: %...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...t size) *pc2 = '\0'; } -static ssize_t cfq_cgroup_read(struct cgroup *cont, struct cftype *cft, - struct file *file, char __user *userbuf, - size_t nbytes, loff_t *ppos) -{ - struct cfq_cgroup *cfqc; - char *page; - ssize_t ret; - struct rb_node *p; - - page = (char *)__get_free_page(GFP_TEMPORARY); - if (!page) - return -ENOMEM; - - cgroup_lock(); - if (cgroup_is_removed(cont)) { - cgroup_unlock(); - ret = -ENODEV; - goto out; - } - - cfqc = cgroup_to_cfq_cgroup(cont); - - cgroup_unlock(); - - /* print priority */ - ret = snprintf(page, PAGE_SIZE, "default priority: %...
2006 Aug 17
5
Re: [XenPPC] Xencomm for xen/ia64
(CCed to xen-devel for completeness. ;) On Wed, 2006-08-16 at 17:24 +0200, Tristan Gingold wrote: > I am porting xen-ppc''s xencomm to xen/ia64. > Currently on xen/ia64 copy_from/to_guest uses guest virtual address. This > works well as long as the virtual addresses are in the TLB. When not in TLB > (or vTLB) the hypercall can''t success without domain help. The
2020 Nov 03
0
[PATCH v3 2/2] vhost-vdpa: fix page pinning leakage in error path
...o the >>>>>> possible optimization on top (which is still questionable to me). >>>>> OK. Unfortunately, this was picked and got merged in upstream. So I will >>>>> post a follow up patch set to 1) revert the commit to the original >>>>> __get_free_page() implementation, and 2) fix the accounting and leakage >>>>> on top. Will it be fine? >>>> Fine. >>>> >>>> Thanks >>> Fine by me too. >>> >> Thanks, Michael & Jason. I will post the fix shortly. Stay tuned. >> &gt...
2023 Jan 20
0
[PATCH v2 04/10] iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous()
...I think the point may have been that the sgtable metadata is a logically-distinct allocation from the buffer pages themselves. Much like the allocation of the pages array itself further down in __iommu_dma_alloc_pages(). I see these days it wouldn't be catastrophic to pass GFP_HIGHMEM into __get_free_page() via sg_kmalloc(), but still, allocating implementation-internal metadata with all the same constraints as a DMA buffer has just as much smell of wrong about it IMO. I'd say the more confusing thing about this particular context is why we're using iommu_map_sg_atomic() further down - t...
2008 Oct 29
0
[PATCH][cfq-cgroups] Introduce cgroups structure with ioprio entry.
...roup *cont) +{ + kfree(cgroup_to_cfq_cgroup(cont)); +} + +static ssize_t cfq_cgroup_read(struct cgroup *cont, struct cftype *cft, + struct file *file, char __user *userbuf, + size_t nbytes, loff_t *ppos) +{ + struct cfq_cgroup *cfqc; + char *page; + ssize_t ret; + + page = (char *)__get_free_page(GFP_TEMPORARY); + if (!page) + return -ENOMEM; + + cgroup_lock(); + if (cgroup_is_removed(cont)) { + cgroup_unlock(); + ret = -ENODEV; + goto out; + } + + cfqc = cgroup_to_cfq_cgroup(cont); + + cgroup_unlock(); + + /* print priority */ + ret = snprintf(page, PAGE_SIZE, "%d \n", cfqc-&...
2020 Nov 03
0
[PATCH 1/2] Revert "vhost-vdpa: fix page pinning leakage in error path"
...signed long locked, lock_limit, pinned, i; > u64 iova = msg->iova; > - long pinned; > int ret = 0; > > if (vhost_iotlb_itree_first(iotlb, msg->iova, > msg->iova + msg->size - 1)) > return -EEXIST; > > + page_list = (struct page **) __get_free_page(GFP_KERNEL); > + if (!page_list) > + return -ENOMEM; > + > if (msg->perm & VHOST_ACCESS_WO) > gup_flags |= FOLL_WRITE; > > @@ -608,86 +610,61 @@ static int vhost_vdpa_process_iotlb_update(struct vhost_vdpa *v, > if (!npages) > return -EINVAL; >...
2023 Jan 29
1
[PATCH v3 2/2] vdpasim: support doorbell mapping
...dpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr, > set_dma_ops(dev, &vdpasim_dma_ops); > vdpasim->vdpa.mdev = dev_attr->mgmt_dev; > > + INIT_DELAYED_WORK(&vdpasim->notify_work, vdpasim_notify_work); > + > + vdpasim->notify = __get_free_page(GFP_KERNEL | __GFP_ZERO); > + if (!vdpasim->notify) > + goto err_iommu; We can simply avoid the advertising notification area in this case. > + *(u16 *)vdpasim->notify = VDPASIM_NOTIFY_DEFVAL; WRITE_ONCE()? > + > vdpasim->config = kzallo...
2020 Oct 01
0
[PATCH] vhost-vdpa: fix page pinning leakage in error path
...d long map_pfn, last_pfn = 0; + unsigned long npages, lock_limit; + unsigned long i, nmap = 0; u64 iova = msg->iova; + long pinned; int ret = 0; if (vhost_iotlb_itree_first(iotlb, msg->iova, msg->iova + msg->size - 1)) return -EEXIST; - page_list = (struct page **) __get_free_page(GFP_KERNEL); - if (!page_list) - return -ENOMEM; - if (msg->perm & VHOST_ACCESS_WO) gup_flags |= FOLL_WRITE; @@ -614,61 +614,86 @@ static int vhost_vdpa_process_iotlb_update(struct vhost_vdpa *v, if (!npages) return -EINVAL; + page_list = kvmalloc_array(npages, sizeof(struct p...
2020 Oct 01
0
[PATCH v2] vhost-vdpa: fix page pinning leakage in error path
...d long map_pfn, last_pfn = 0; + unsigned long npages, lock_limit; + unsigned long i, nmap = 0; u64 iova = msg->iova; + long pinned; int ret = 0; if (vhost_iotlb_itree_first(iotlb, msg->iova, msg->iova + msg->size - 1)) return -EEXIST; - page_list = (struct page **) __get_free_page(GFP_KERNEL); - if (!page_list) - return -ENOMEM; - if (msg->perm & VHOST_ACCESS_WO) gup_flags |= FOLL_WRITE; @@ -614,61 +614,86 @@ static int vhost_vdpa_process_iotlb_update(struct vhost_vdpa *v, if (!npages) return -EINVAL; + page_list = kvmalloc_array(npages, sizeof(struct p...
2023 Jan 18
4
[PATCH v2 04/10] iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous()
Change the sg_alloc_table_from_pages() allocation that was hardwired to GFP_KERNEL to use the gfp parameter like the other allocations in this function. Auditing says this is never called from an atomic context, so it is safe as is, but reads wrong. Signed-off-by: Jason Gunthorpe <jgg at nvidia.com> --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff
2023 Jan 18
4
[PATCH v2 04/10] iommu/dma: Use the gfp parameter in __iommu_dma_alloc_noncontiguous()
Change the sg_alloc_table_from_pages() allocation that was hardwired to GFP_KERNEL to use the gfp parameter like the other allocations in this function. Auditing says this is never called from an atomic context, so it is safe as is, but reads wrong. Signed-off-by: Jason Gunthorpe <jgg at nvidia.com> --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff
2010 Jul 28
23
HVM hypercalls
Hi I need to use hypercalls from HVM domain (e.g. HYPERVISOR_add_to_physmap). However, it does not work when I am trying to invoke it from HVM Linux guest. Basically, I don''t see that anything happens on hypervisor''s side. I also grep''ed the guest code for ''vmmcall''/''vmcall'' and did not find anything. Is it possible to do it at all?
2008 Feb 21
4
[PATCH 0/2] xen pvfb: Para-virtual framebuffer, keyboard and pointer
This is a pair of Xen para-virtual frontend device drivers: drivers/video/xen-fbfront.c provides a framebuffer, and drivers/input/xen-kbdfront provides keyboard and mouse. The backends run in dom0 user space. I started with the Xen version at http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/ca05cf1a9bdc Differences to that Xen version, for those who care: * Rewritten on top of fb deferred