search for: __gfp_highmem

Displaying 20 results from an estimated 139 matches for "__gfp_highmem".

2015 Dec 01
2
[PATCH] virtio: Do not drop __GFP_HIGH in alloc_indirect
From: Michal Hocko <mhocko at suse.com> b92b1b89a33c ("virtio: force vring descriptors to be allocated from lowmem") tried to exclude highmem pages for descriptors so it cleared __GFP_HIGHMEM from a given gfp mask. The patch also cleared __GFP_HIGH which doesn't make much sense for this fix because __GFP_HIGH only controls access to memory reserves and it doesn't have any influence on the zone selection. Some of the call paths use GFP_ATOMIC and dropping __GFP_HIGH will reduce t...
2015 Dec 01
2
[PATCH] virtio: Do not drop __GFP_HIGH in alloc_indirect
From: Michal Hocko <mhocko at suse.com> b92b1b89a33c ("virtio: force vring descriptors to be allocated from lowmem") tried to exclude highmem pages for descriptors so it cleared __GFP_HIGHMEM from a given gfp mask. The patch also cleared __GFP_HIGH which doesn't make much sense for this fix because __GFP_HIGH only controls access to memory reserves and it doesn't have any influence on the zone selection. Some of the call paths use GFP_ATOMIC and dropping __GFP_HIGH will reduce t...
2015 Dec 01
0
[PATCH] virtio: Do not drop __GFP_HIGH in alloc_indirect
On Tue, Dec 01, 2015 at 03:32:49PM +0100, Michal Hocko wrote: > From: Michal Hocko <mhocko at suse.com> > > b92b1b89a33c ("virtio: force vring descriptors to be allocated from > lowmem") tried to exclude highmem pages for descriptors so it cleared > __GFP_HIGHMEM from a given gfp mask. The patch also cleared __GFP_HIGH > which doesn't make much sense for this fix because __GFP_HIGH only > controls access to memory reserves and it doesn't have any influence > on the zone selection. Some of the call paths use GFP_ATOMIC and > dropping __GF...
2016 Mar 11
0
[PATCH v1 19/19] zram: use __GFP_MOVABLE for memory allocation
.../zram_drv.c index 370c2f76016d..10f6ff1cf6a0 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -514,7 +514,8 @@ static struct zram_meta *zram_meta_alloc(char *pool_name, u64 disksize) goto out_error; } - meta->mem_pool = zs_create_pool(pool_name, GFP_NOIO | __GFP_HIGHMEM); + meta->mem_pool = zs_create_pool(pool_name, GFP_NOIO|__GFP_HIGHMEM + |__GFP_MOVABLE); if (!meta->mem_pool) { pr_err("Error creating memory pool\n"); goto out_error; diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index b9ff698115a1..a1f47a7b3a99 100644 --- a/mm/zsmalloc.c...
2018 Apr 13
3
[RFC v2] virtio: support packed ring
...gfp) > > +{ > > + struct vring_packed_desc *desc; > > + > > + /* > > + * We require lowmem mappings for the descriptors because > > + * otherwise virt_to_phys will give us bogus addresses in the > > + * virtqueue. > > + */ > > + gfp &= ~__GFP_HIGHMEM; > > + > > + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp); > > Can we simply check vq->packed here to avoid duplicating helpers? Then it would be something like this: static void *alloc_indirect(struct virtqueue *_vq, unsigned int total_sg, gfp_t g...
2018 Apr 13
3
[RFC v2] virtio: support packed ring
...gfp) > > +{ > > + struct vring_packed_desc *desc; > > + > > + /* > > + * We require lowmem mappings for the descriptors because > > + * otherwise virt_to_phys will give us bogus addresses in the > > + * virtqueue. > > + */ > > + gfp &= ~__GFP_HIGHMEM; > > + > > + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp); > > Can we simply check vq->packed here to avoid duplicating helpers? Then it would be something like this: static void *alloc_indirect(struct virtqueue *_vq, unsigned int total_sg, gfp_t g...
2012 Oct 18
1
[PATCH] virtio: 9p: correctly pass physical address to userspace for high pages
...((unsigned long)desc & ~PAGE_MASK); > vq->vring.desc[head].len = i * sizeof(struct vring_desc); Gah, virt_to_phys_harder()? What's the performance effect? If it's negligible, why doesn't virt_to_phys() just do this for us? We do have an alternate solution: masking out __GFP_HIGHMEM from the kmalloc of desc. If it fails, we will fall back to laying out the virtio request directly inside the ring; if it doesn't fit, we'll wait for the device to consume more buffers. > @@ -325,7 +326,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan, > int count = n...
2012 Oct 18
1
[PATCH] virtio: 9p: correctly pass physical address to userspace for high pages
...((unsigned long)desc & ~PAGE_MASK); > vq->vring.desc[head].len = i * sizeof(struct vring_desc); Gah, virt_to_phys_harder()? What's the performance effect? If it's negligible, why doesn't virt_to_phys() just do this for us? We do have an alternate solution: masking out __GFP_HIGHMEM from the kmalloc of desc. If it fails, we will fall back to laying out the virtio request directly inside the ring; if it doesn't fit, we'll wait for the device to consume more buffers. > @@ -325,7 +326,7 @@ static int p9_get_mapped_pages(struct virtio_chan *chan, > int count = n...
2018 Apr 17
0
[RFC v2] virtio: support packed ring
...gt;> + struct vring_packed_desc *desc; >>> + >>> + /* >>> + * We require lowmem mappings for the descriptors because >>> + * otherwise virt_to_phys will give us bogus addresses in the >>> + * virtqueue. >>> + */ >>> + gfp &= ~__GFP_HIGHMEM; >>> + >>> + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp); >> Can we simply check vq->packed here to avoid duplicating helpers? > Then it would be something like this: > > static void *alloc_indirect(struct virtqueue *_vq, unsigned int total_s...
2016 Jul 11
1
[PATCH] virtio: don't warn if we can't allocate indirect sglist
...============================================== --- linux-4.7-rc7.orig/drivers/virtio/virtio_ring.c 2016-05-09 17:45:04.000000000 +0200 +++ linux-4.7-rc7/drivers/virtio/virtio_ring.c 2016-07-11 17:30:20.000000000 +0200 @@ -237,6 +237,12 @@ static struct vring_desc *alloc_indirect */ gfp &= ~__GFP_HIGHMEM; + /* + * Don't warn if the allocation fails, because the driver + * handles allocation failures gracefully. + */ + gfp |= __GFP_NOWARN; + desc = kmalloc(total_sg * sizeof(struct vring_desc), gfp); if (!desc) return NULL;
2016 Jul 11
1
[PATCH] virtio: don't warn if we can't allocate indirect sglist
...============================================== --- linux-4.7-rc7.orig/drivers/virtio/virtio_ring.c 2016-05-09 17:45:04.000000000 +0200 +++ linux-4.7-rc7/drivers/virtio/virtio_ring.c 2016-07-11 17:30:20.000000000 +0200 @@ -237,6 +237,12 @@ static struct vring_desc *alloc_indirect */ gfp &= ~__GFP_HIGHMEM; + /* + * Don't warn if the allocation fails, because the driver + * handles allocation failures gracefully. + */ + gfp |= __GFP_NOWARN; + desc = kmalloc(total_sg * sizeof(struct vring_desc), gfp); if (!desc) return NULL;
2019 Apr 25
6
[PATCH v4 0/4] vmw_balloon: Compaction and shrinker support
VMware balloon enhancements: adding support for memory compaction, memory shrinker (to prevent OOM) and splitting of refused pages to prevent recurring inflations. Patches 1-2: Support for compaction Patch 3: Support for memory shrinker - disabled by default Patch 4: Split refused pages to improve performance v3->v4: * "get around to" comment [Michael] * Put list_add under page lock
2019 Apr 25
6
[PATCH v4 0/4] vmw_balloon: Compaction and shrinker support
VMware balloon enhancements: adding support for memory compaction, memory shrinker (to prevent OOM) and splitting of refused pages to prevent recurring inflations. Patches 1-2: Support for compaction Patch 3: Support for memory shrinker - disabled by default Patch 4: Split refused pages to improve performance v3->v4: * "get around to" comment [Michael] * Put list_add under page lock
2012 Jan 26
1
[PATCH] btrfs: mask out gfp flasg in releasepage
...--- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -961,6 +961,13 @@ static int btree_releasepage(struct page *page, gfp_t gfp_flags) tree = &BTRFS_I(page->mapping->host)->io_tree; map = &BTRFS_I(page->mapping->host)->extent_tree; + /* + * We need to mask out eg. __GFP_HIGHMEM and __GFP_DMA32 as we''re doing + * slab allocation from alloc_extent_state down the callchain where + * it''d hit a BUG_ON as those flags are not allowed. + */ + gfp_flags &= ~GFP_SLAB_BUG_MASK; + ret = try_release_extent_state(map, tree, page, gfp_flags); if (!ret) r...
2019 Apr 23
5
[PATCH v3 0/4] vmw_balloon: compaction and shrinker support
VMware balloon enhancements: adding support for memory compaction, memory shrinker (to prevent OOM) and splitting of refused pages to prevent recurring inflations. Patches 1-2: Support for compaction Patch 3: Support for memory shrinker - disabled by default Patch 4: Split refused pages to improve performance v2->v3: * Fixing wrong argument type (int->size_t) [Michael] * Fixing a comment
2012 Oct 19
5
[PATCH v2 1/3] mm: highmem: export kmap_to_page for modules
Some virtio device drivers (9p) need to translate high virtual addresses to physical addresses, which are inserted into the virtqueue for processing by userspace. This patch exports the kmap_to_page symbol, so that the affected drivers can be compiled as modules. Signed-off-by: Will Deacon <will.deacon at arm.com> --- mm/highmem.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
2012 Oct 19
5
[PATCH v2 1/3] mm: highmem: export kmap_to_page for modules
Some virtio device drivers (9p) need to translate high virtual addresses to physical addresses, which are inserted into the virtqueue for processing by userspace. This patch exports the kmap_to_page symbol, so that the affected drivers can be compiled as modules. Signed-off-by: Will Deacon <will.deacon at arm.com> --- mm/highmem.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...t; > > + > > > > + /* > > > > + * We require lowmem mappings for the descriptors because > > > > + * otherwise virt_to_phys will give us bogus addresses in the > > > > + * virtqueue. > > > > + */ > > > > + gfp &= ~__GFP_HIGHMEM; > > > > + > > > > + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp); > > > Can we simply check vq->packed here to avoid duplicating helpers? > > Then it would be something like this: > > > > static void *alloc_indirect(struct...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...t; > > + > > > > + /* > > > > + * We require lowmem mappings for the descriptors because > > > > + * otherwise virt_to_phys will give us bogus addresses in the > > > > + * virtqueue. > > > > + */ > > > > + gfp &= ~__GFP_HIGHMEM; > > > > + > > > > + desc = kmalloc(total_sg * sizeof(struct vring_packed_desc), gfp); > > > Can we simply check vq->packed here to avoid duplicating helpers? > > Then it would be something like this: > > > > static void *alloc_indirect(struct...
2017 Jan 26
0
[PATCH 3/3] virtio_ring: Use kmalloc_array() in alloc_indirect()
...f --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 409aeaa49246..34b6b694298c 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -247,8 +247,7 @@ static struct vring_desc *alloc_indirect(struct virtqueue *_vq, * virtqueue. */ gfp &= ~__GFP_HIGHMEM; - - desc = kmalloc(total_sg * sizeof(struct vring_desc), gfp); + desc = kmalloc_array(total_sg, sizeof(*desc), gfp); if (!desc) return NULL; -- 2.11.0