linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: 2.6.0-test9-mm4
Date: Wed, 19 Nov 2003 02:13:22 -0800	[thread overview]
Message-ID: <20031119101322.GQ22764@holomorphy.com> (raw)
In-Reply-To: <20031119093340.GP22764@holomorphy.com>

William Lee Irwin III <wli@holomorphy.com> wrote:
>>> +#ifdef CONFIG_SMP
>>> +#define smp_local_irq_save(x)		local_irq_save(x)
>>> +#define smp_local_irq_restore(x)	local_irq_restore(x)
>>> +#define smp_local_irq_disable()		local_irq_disable()
>>> +#define smp_local_irq_enable()		local_irq_enable()
>>> +#else
[...]

On Wed, Nov 19, 2003 at 01:19:51AM -0800, Andrew Morton wrote:
>> Interesting.

On Wed, Nov 19, 2003 at 01:33:40AM -0800, William Lee Irwin III wrote:
> This was a micro-optimization for UP; the SMP case needs to protect
> against reentry via interrupts due to smp_call_function(). UP can
> just disable preemption. In principle, the two cases could be made
> uniform at the cost of disabling interrupts unnecessarily on UP.

The following, incremental atop the first, removes the smp_local_irq_*()
macros.


-- wli


diff -prauN mm4-2.6.0-test9-2/arch/i386/mm/pgtable.c mm4-2.6.0-test9-3/arch/i386/mm/pgtable.c
--- mm4-2.6.0-test9-2/arch/i386/mm/pgtable.c	2003-11-19 00:22:54.000000000 -0800
+++ mm4-2.6.0-test9-3/arch/i386/mm/pgtable.c	2003-11-19 02:07:13.000000000 -0800
@@ -177,7 +177,7 @@ static inline struct page *pte_alloc_rea
 	unsigned long flags;
 	struct page *page = NULL;
 
-	smp_local_irq_save(flags);
+	local_irq_save(flags);
 	if (tlb->nr_pte_ready) {
 		int z;
 		for (z = MAX_ZONE_ID - 1; z >= 0; --z) {
@@ -194,7 +194,7 @@ static inline struct page *pte_alloc_rea
 		tlb->ready_count[z]--;
 		tlb->nr_pte_ready--;
 	}
-	smp_local_irq_restore(flags);
+	local_irq_restore(flags);
 	put_cpu();
 	return page;
 }
@@ -381,7 +381,7 @@ static void shrink_cpu_pagetable_cache(v
 	high = !!(gfp_mask & __GFP_HIGHMEM);
 	cpu = get_cpu();
 	tlb = &per_cpu(mmu_gathers, cpu);
-	smp_local_irq_save(flags);
+	local_irq_save(flags);
 
 	if (tlb->nr_pte_active)
 		tlb_flush(tlb);
@@ -417,7 +417,7 @@ static void shrink_cpu_pagetable_cache(v
 		tlb->ready_count[zone] = 0;
 	}
 
-	smp_local_irq_restore(flags);
+	local_irq_restore(flags);
 	put_cpu();
 }
 
diff -prauN mm4-2.6.0-test9-2/include/asm-i386/system.h mm4-2.6.0-test9-3/include/asm-i386/system.h
--- mm4-2.6.0-test9-2/include/asm-i386/system.h	2003-11-19 00:09:43.000000000 -0800
+++ mm4-2.6.0-test9-3/include/asm-i386/system.h	2003-11-19 02:06:11.000000000 -0800
@@ -461,18 +461,6 @@ struct alt_instr { 
 /* For spinlocks etc */
 #define local_irq_save(x)	__asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")
 
-#ifdef CONFIG_SMP
-#define smp_local_irq_save(x)		local_irq_save(x)
-#define smp_local_irq_restore(x)	local_irq_restore(x)
-#define smp_local_irq_disable()		local_irq_disable()
-#define smp_local_irq_enable()		local_irq_enable()
-#else
-#define smp_local_irq_save(x)		do { (void)(x); } while (0)
-#define smp_local_irq_restore(x)	do { (void)(x); } while (0)
-#define smp_local_irq_disable()		do { } while (0)
-#define smp_local_irq_enable()		do { } while (0)
-#endif /* CONFIG_SMP */
-
 /*
  * disable hlt during certain critical i/o operations
  */
diff -prauN mm4-2.6.0-test9-2/include/asm-i386/tlb.h mm4-2.6.0-test9-3/include/asm-i386/tlb.h
--- mm4-2.6.0-test9-2/include/asm-i386/tlb.h	2003-11-19 00:23:35.000000000 -0800
+++ mm4-2.6.0-test9-3/include/asm-i386/tlb.h	2003-11-19 02:06:58.000000000 -0800
@@ -106,7 +106,7 @@ void tlb_flush_mmu(struct mmu_gather *tl
 	tlb->need_flush = 0;
 	tlb_flush(tlb);
 
-	smp_local_irq_save(flags);
+	local_irq_save(flags);
 
 	if (tlb->nr_nonpte) {
 		free_pages_and_swap_cache(tlb->nonpte, tlb->nr_nonpte);
@@ -126,7 +126,7 @@ void tlb_flush_mmu(struct mmu_gather *tl
 	if (tlb->nr_pte_ready >= NR_PTE)
 		tlb_flush_ready(tlb);
 
-	smp_local_irq_restore(flags);
+	local_irq_restore(flags);
 }
 
 static inline
@@ -163,13 +163,13 @@ void tlb_remove_page(struct mmu_gather *
 {
 	unsigned long flags;
 
-	smp_local_irq_save(flags);
+	local_irq_save(flags);
 	tlb->need_flush = 1;
 	if (PagePTE(page))
 		tlb_remove_pte_page(tlb, page);
 	else
 		tlb_remove_nonpte_page(tlb, page);
-	smp_local_irq_restore(flags);
+	local_irq_restore(flags);
 }
 
 #endif /* _I386_TLB_H */
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2003-11-19 10:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19  6:51 2.6.0-test9-mm4 Andrew Morton
2003-11-19  9:02 ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19  9:19   ` 2.6.0-test9-mm4 Andrew Morton
2003-11-19  9:33     ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 10:13       ` William Lee Irwin III [this message]
2003-11-19 10:34         ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 10:50           ` 2.6.0-test9-mm4 William Lee Irwin III
2003-11-19 11:13 ` 2.6.0-test9-mm4 Gene Heskett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031119101322.GQ22764@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox