Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71971
b: refs/heads/master
c: eb3fa7c
h: refs/heads/master
i:
  71969: 9b683d1
  71967: 8266552
v: v3
  • Loading branch information
Keshavamurthy, Anil S authored and Linus Torvalds committed Oct 22, 2007
1 parent 4e6bf86 commit 3627456
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba39592764ed20cee09aae5352e603a27bf56b0d
refs/heads/master: eb3fa7cb51a2a35cd95eb92e65d8039c779468a5
30 changes: 26 additions & 4 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,31 @@ static struct kmem_cache *iommu_domain_cache;
static struct kmem_cache *iommu_devinfo_cache;
static struct kmem_cache *iommu_iova_cache;

static inline void *iommu_kmem_cache_alloc(struct kmem_cache *cachep)
{
unsigned int flags;
void *vaddr;

/* trying to avoid low memory issues */
flags = current->flags & PF_MEMALLOC;
current->flags |= PF_MEMALLOC;
vaddr = kmem_cache_alloc(cachep, GFP_ATOMIC);
current->flags &= (~PF_MEMALLOC | flags);
return vaddr;
}


static inline void *alloc_pgtable_page(void)
{
return (void *)get_zeroed_page(GFP_ATOMIC);
unsigned int flags;
void *vaddr;

/* trying to avoid low memory issues */
flags = current->flags & PF_MEMALLOC;
current->flags |= PF_MEMALLOC;
vaddr = (void *)get_zeroed_page(GFP_ATOMIC);
current->flags &= (~PF_MEMALLOC | flags);
return vaddr;
}

static inline void free_pgtable_page(void *vaddr)
Expand All @@ -97,7 +119,7 @@ static inline void free_pgtable_page(void *vaddr)

static inline void *alloc_domain_mem(void)
{
return kmem_cache_alloc(iommu_domain_cache, GFP_ATOMIC);
return iommu_kmem_cache_alloc(iommu_domain_cache);
}

static inline void free_domain_mem(void *vaddr)
Expand All @@ -107,7 +129,7 @@ static inline void free_domain_mem(void *vaddr)

static inline void * alloc_devinfo_mem(void)
{
return kmem_cache_alloc(iommu_devinfo_cache, GFP_ATOMIC);
return iommu_kmem_cache_alloc(iommu_devinfo_cache);
}

static inline void free_devinfo_mem(void *vaddr)
Expand All @@ -117,7 +139,7 @@ static inline void free_devinfo_mem(void *vaddr)

struct iova *alloc_iova_mem(void)
{
return kmem_cache_alloc(iommu_iova_cache, GFP_ATOMIC);
return iommu_kmem_cache_alloc(iommu_iova_cache);
}

void free_iova_mem(struct iova *iova)
Expand Down

0 comments on commit 3627456

Please sign in to comment.