Skip to contentSkip to conversation

does this patch look remotely sane?

RFC PATCH In review Robert P. J. Day 2 participants 3 messages Dec 20, 2006

Subsystems (10)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 does this patch look remotely sane?

followup to my previous question, if that equivalence holds, does
this patch look like it would make sense?

 arch/frv/mm/pgalloc.c               |    4 ++--
 arch/i386/mm/pageattr.c             |    2 +-
 arch/i386/mm/pgtable.c              |    4 ++--
 arch/powerpc/mm/pgtable_32.c        |    2 +-
 arch/ppc/mm/pgtable.c               |    2 +-
 arch/sparc64/mm/init.c              |    2 +-
 arch/x86_64/mm/pageattr.c           |    2 +-
 arch/xtensa/mm/init.c               |    2 +-
 include/asm-arm/pgalloc.h           |    2 +-
 include/asm-avr32/pgalloc.h         |    2 +-
 include/asm-cris/pgalloc.h          |    2 +-
 include/asm-m68k/motorola_pgalloc.h |    2 +-
 include/asm-m68k/sun3_pgalloc.h     |    2 +-
 include/asm-sh64/pgalloc.h          |    2 +-
 include/linux/pagemap.h             |    2 +-
 include/net/sock.h                  |    2 +-
 kernel/kexec.c                      |    2 +-
 mm/filemap.c                        |    2 +-
 mm/page_alloc.c                     |    2 +-
 net/core/pktgen.c                   |    4 ++--
 net/core/skbuff.c                   |    2 +-
 net/core/sock.c                     |    2 +-
 net/ipv4/ip_output.c                |    2 +-
 net/ipv6/ip6_output.c               |    2 +-
 24 files changed, 27 insertions(+), 27 deletions(-)
arch/frv/mm/pgalloc.c +2 -2
index 19b13be..9a06a8d 100644
@@ -33,9 +33,9 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 	struct page *page;
 
 #ifdef CONFIG_HIGHPTE
-	page = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0);
+	page = alloc_page(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT);
 #else
-	page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
+	page = alloc_page(GFP_KERNEL|__GFP_REPEAT);
 #endif
 	if (page)
 		clear_highpage(page);
arch/i386/mm/pageattr.c +1 -1
index ad91528..dfec242 100644
@@ -45,7 +45,7 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot,
 	pte_t *pbase;
 
 	spin_unlock_irq(&cpa_lock);
-	base = alloc_pages(GFP_KERNEL, 0);
+	base = alloc_page(GFP_KERNEL);
 	spin_lock_irq(&cpa_lock);
 	if (!base)
 		return NULL;
arch/i386/mm/pgtable.c +2 -2
index f349eaf..c015abb 100644
@@ -189,9 +189,9 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 	struct page *pte;
 
 #ifdef CONFIG_HIGHPTE
-	pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT|__GFP_ZERO, 0);
+	pte = alloc_page(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT|__GFP_ZERO);
 #else
-	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+	pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
 #endif
 	return pte;
 }
arch/powerpc/mm/pgtable_32.c +1 -1
index 1891dbe..9e418f7 100644
@@ -119,7 +119,7 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 	gfp_t flags = GFP_KERNEL | __GFP_REPEAT;
 #endif
 
-	ptepage = alloc_pages(flags, 0);
+	ptepage = alloc_page(flags);
 	if (ptepage)
 		clear_highpage(ptepage);
 	return ptepage;
arch/ppc/mm/pgtable.c +1 -1
index 354a940..376bd84 100644
@@ -118,7 +118,7 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 	gfp_t flags = GFP_KERNEL | __GFP_REPEAT;
 #endif
 
-	ptepage = alloc_pages(flags, 0);
+	ptepage = alloc_page(flags);
 	if (ptepage)
 		clear_highpage(ptepage);
 	return ptepage;
arch/sparc64/mm/init.c +1 -1
index a8e8802..34cc83b 100644
@@ -1478,7 +1478,7 @@ void __init mem_init(void)
 	 * Set up the zero page, mark it reserved, so that page count
 	 * is not manipulated when freeing the page from user ptes.
 	 */
-	mem_map_zero = alloc_pages(GFP_KERNEL|__GFP_ZERO, 0);
+	mem_map_zero = alloc_page(GFP_KERNEL|__GFP_ZERO);
 	if (mem_map_zero = NULL) {
 		prom_printf("paging_init: Cannot alloc zero page.\n");
 		prom_halt();
arch/x86_64/mm/pageattr.c +1 -1
index ccb91dd..d967902 100644
@@ -40,7 +40,7 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot,
 {
 	int i;
 	unsigned long addr;
-	struct page *base = alloc_pages(GFP_KERNEL, 0);
+	struct page *base = alloc_page(GFP_KERNEL);
 	pte_t *pbase;
 	if (!base)
 		return NULL;
arch/xtensa/mm/init.c +1 -1
index e1ec2d1..0542ba1 100644
@@ -491,7 +491,7 @@ struct page* pte_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
 	struct page *page;
 
-	page = alloc_pages(GFP_KERNEL | __GFP_REPEAT, 0);
+	page = alloc_page(GFP_KERNEL | __GFP_REPEAT);
 
 	if (likely(page)) {
 		pte_t* ptep = kmap_atomic(page, KM_USER0);
include/asm-arm/pgalloc.h +1 -1
index 4d43945..0555e43 100644
@@ -71,7 +71,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
 	struct page *pte;
 
-	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+	pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
 	if (pte) {
 		void *page = page_address(pte);
 		clean_dcache_area(page, sizeof(pte_t) * PTRS_PER_PTE);
include/asm-avr32/pgalloc.h +1 -1
index bb82e70..d052501 100644
@@ -67,7 +67,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
 	struct page *pte;
 
 	do {
-		pte = alloc_pages(GFP_KERNEL, 0);
+		pte = alloc_page(GFP_KERNEL);
 		if (pte)
 			clear_page(page_address(pte));
 		else {
include/asm-cris/pgalloc.h +1 -1
index deaddfe..6766378 100644
@@ -30,7 +30,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long ad
 static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	struct page *pte;
-	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+	pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
 	return pte;
 }
 
include/asm-m68k/motorola_pgalloc.h +1 -1
index 5158412..1d0389d 100644
@@ -30,7 +30,7 @@ static inline void pte_free_kernel(pte_t *pte)
 
 static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+	struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
 	pte_t *pte;
 
 	if(!page)
include/asm-m68k/sun3_pgalloc.h +1 -1
index fd82411..3ef58bc 100644
@@ -48,7 +48,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 static inline struct page *pte_alloc_one(struct mm_struct *mm,
 					 unsigned long address)
 {
-        struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0);
+        struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT);
 
 	if (page = NULL)
 		return NULL;
include/asm-sh64/pgalloc.h +1 -1
index cb803e5..e25111b 100644
@@ -120,7 +120,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
 {
 	struct page *pte;
 
-	pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+	pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
 
 	return pte;
 }
include/linux/pagemap.h +1 -1
index c3e255b..acdb147 100644
@@ -56,7 +56,7 @@ extern struct page *__page_cache_alloc(gfp_t gfp);
 #else
 static inline struct page *__page_cache_alloc(gfp_t gfp)
 {
-	return alloc_pages(gfp, 0);
+	return alloc_page(gfp);
 }
 #endif
 
include/net/sock.h +1 -1
index 03684e7..0a84cd3 100644
@@ -1248,7 +1248,7 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk)
 {
 	struct page *page = NULL;
 
-	page = alloc_pages(sk->sk_allocation, 0);
+	page = alloc_page(sk->sk_allocation);
 	if (!page) {
 		sk->sk_prot->enter_memory_pressure();
 		sk_stream_moderate_sndbuf(sk);
kernel/kexec.c +1 -1
index 2a59c8a..c03b24b 100644
@@ -698,7 +698,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 		kimage_entry_t *old;
 
 		/* Allocate a page, if we run out of memory give up */
-		page = kimage_alloc_pages(gfp_mask, 0);
+		page = kimage_alloc_page(gfp_mask);
 		if (!page)
 			return NULL;
 		/* If the page cannot be used file it away */
mm/filemap.c +1 -1
index 8332c77..09515d2 100644
@@ -473,7 +473,7 @@ struct page *__page_cache_alloc(gfp_t gfp)
 		int n = cpuset_mem_spread_node();
 		return alloc_pages_node(n, gfp, 0);
 	}
-	return alloc_pages(gfp, 0);
+	return alloc_page(gfp);
 }
 EXPORT_SYMBOL(__page_cache_alloc);
 #endif
mm/page_alloc.c +1 -1
index 8c1a116..59fe076 100644
@@ -1399,7 +1399,7 @@ fastcall unsigned long get_zeroed_page(gfp_t gfp_mask)
 	 */
 	VM_BUG_ON((gfp_mask & __GFP_HIGHMEM) != 0);
 
-	page = alloc_pages(gfp_mask | __GFP_ZERO, 0);
+	page = alloc_page(gfp_mask | __GFP_ZERO);
 	if (page)
 		return (unsigned long) page_address(page);
 	return 0;
net/core/pktgen.c +1 -1
index 1897a3a..72c06e3 100644
@@ -2423,7 +2423,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
 
 		i = 0;
 		while (datalen > 0) {
-			struct page *page = alloc_pages(GFP_KERNEL, 0);
+			struct page *page = alloc_page(GFP_KERNEL);
 			skb_shinfo(skb)->frags[i].page = page;
 			skb_shinfo(skb)->frags[i].page_offset = 0;
 			skb_shinfo(skb)->frags[i].size @@ -2768,7 +2768,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,

i = 0;
while (datalen > 0) {
- struct page *page = alloc_pages(GFP_KERNEL, 0);
+ struct page *page = alloc_page(GFP_KERNEL);
skb_shinfo(skb)->frags[i].page = page; skb_shinfo(skb)->frags[i].page_offset = 0; skb_shinfo(skb)->frags[i].size diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index de7801d..26d70d0 100644

net/core/skbuff.c +1 -1
@@ -1854,7 +1854,7 @@ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
 			return -EFAULT;
 
 		/* allocate a new page for next frag */
-		page = alloc_pages(sk->sk_allocation, 0);
+		page = alloc_page(sk->sk_allocation);
 
 		/* If alloc_page fails just return failure and caller will
 		 * free previous allocated pages by doing kfree_skb()
net/core/sock.c +1 -1
index 0ed5b4f..d1a9c73 100644
@@ -1167,7 +1167,7 @@ static struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
 					struct page *page;
 					skb_frag_t *frag;
 
-					page = alloc_pages(sk->sk_allocation, 0);
+					page = alloc_page(sk->sk_allocation);
 					if (!page) {
 						err = -ENOBUFS;
 						skb_shinfo(skb)->nr_frags = i;
net/ipv4/ip_output.c +1 -1
index f071f84..d88eacc 100644
@@ -998,7 +998,7 @@ alloc_new_skb:
 			} else if (i < MAX_SKB_FRAGS) {
 				if (copy > PAGE_SIZE)
 					copy = PAGE_SIZE;
-				page = alloc_pages(sk->sk_allocation, 0);
+				page = alloc_page(sk->sk_allocation);
 				if (page = NULL)  {
 					err = -ENOMEM;
 					goto error;
net/ipv6/ip6_output.c +1 -1
index 7b7bd44..475998f 100644
@@ -1234,7 +1234,7 @@ alloc_new_skb:
 			} else if(i < MAX_SKB_FRAGS) {
 				if (copy > PAGE_SIZE)
 					copy = PAGE_SIZE;
-				page = alloc_pages(sk->sk_allocation, 0);
+				page = alloc_page(sk->sk_allocation);
 				if (page = NULL) {
 					err = -ENOMEM;
 					goto error;

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 7 lines · Robert P. J. Day

followup to my previous question, if that equivalence holds, does
this patch look like it would make sense?

kernel/kexec.c static struct page *kimage_alloc_page(struct kimage *image, · line 704

Quoted 8 lines
kernel/kexec.c +1 -1
@@ -698,7 +698,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 		kimage_entry_t *old;
 
 		/* Allocate a page, if we run out of memory give up */
-		page = kimage_alloc_pages(gfp_mask, 0);
+		page = kimage_alloc_page(gfp_mask);
 		if (!page)
 			return NULL;
 		/* If the page cannot be used file it away */

Equivalence is limited to alloc_page, though :).

Regards,
Frederik

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Robert P. J. Day
Quoted 10 lines · Frederik Deweerdt
Quoted 9 lines · Robert P. J. Day

followup to my previous question, if that equivalence holds, does
this patch look like it would make sense?

kernel/kexec.c +0 -0
@@ -698,7 +698,7 @@ static struct page *kimage_alloc_page(struct kimage *image,
 		kimage_entry_t *old;
 
Quoted 7 lines

kernel/kexec.c static struct page *kimage_alloc_page(struct kimage *image, · line 704

Quoted 6 lines
kernel/kexec.c +1 -1
 		/* Allocate a page, if we run out of memory give up */
-		page = kimage_alloc_pages(gfp_mask, 0);
+		page = kimage_alloc_page(gfp_mask);
 		if (!page)
 			return NULL;
 		/* If the page cannot be used file it away */

Equivalence is limited to alloc_page, though :).

ah, quite right, i missed that. better tighten up the regular expression. thanks.

rday
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors