virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andi Kleen <ak@suse.de>,
	virtualization@lists.osdl.org,
	lkml <linux-kernel@vger.kernel.org>,
	William Lee Irwin III <wli@holomorphy.com>,
	Zachary Amsden <zach@vmware.com>,
	Christoph Lameter <clameter@sgi.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch 07/20] Allow paravirt backend to choose kernel PMD sharing
Date: Fri, 6 Apr 2007 17:28:44 -0700	[thread overview]
Message-ID: <20070406172844.12f7b8e7.akpm@linux-foundation.org> (raw)
In-Reply-To: <4616DFB2.4020802@goop.org>

On Fri, 06 Apr 2007 17:02:58 -0700 Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Andrew Morton wrote:
> > All this paravirt stuff isn't making the kernel any prettier, is it?
> >   
> 
> You're too kind.  wli's comment on the first version of this patch was
> something along the lines of "this patch causes a surprising amount of
> damage for what little it achieves".

Damn, I wish I'd said that.

> >> ...
> >>  
> >> -#ifndef CONFIG_X86_PAE
> >> -void vmalloc_sync_all(void)
> >> +void _vmalloc_sync_all(void)
> >>  {
> >>  	/*
> >>  	 * Note that races in the updates of insync and start aren't
> >> @@ -600,6 +599,8 @@ void vmalloc_sync_all(void)
> >>  	static DECLARE_BITMAP(insync, PTRS_PER_PGD);
> >>  	static unsigned long start = TASK_SIZE;
> >>  	unsigned long address;
> >> +
> >> +	BUG_ON(SHARED_KERNEL_PMD);
> >>  
> >>  	BUILD_BUG_ON(TASK_SIZE & ~PGDIR_MASK);
> >>  	for (address = start; address >= TASK_SIZE; address += PGDIR_SIZE) {
> >> @@ -623,4 +624,3 @@ void vmalloc_sync_all(void)
> >>  			start = address + PGDIR_SIZE;
> >>  	}
> >>  }
> >>     
> >
> > This is a functional change for non-paravirt kernels.  Non-PAE kernels now
> > get a vmalloc_sync_all().  How come?
> >   
> 
> You mean PAE kernels get a vmalloc_sync_all?

err, yes.

> When we're in PAE mode, but SHARED_KERNEL_PMD is false (which is true
> for Xen, but not for native execution), then the kernel mappings are not
> implicitly shared between processes.  This means that the vmalloc
> mappings are not shared, and so need to be explicitly synchronized
> between pagetables, like in the !PAE case.

head spins.

> > Your change clashes pretty fundamantally with
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc5/2.6.21-rc5-mm4/broken-out/move-die-notifier-handling-to-common-code-fix-vmalloc_sync_all.patch,
> > and
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc5/2.6.21-rc5-mm4/broken-out/move-die-notifier-handling-to-common-code.patch
> > _does_ make the kernel prettier.
> >   
> 
> Hm, it doesn't look like a deep clash.  Dropping the inline function and
> just putting the "if (SHARED_KERNEL_PMD) return;" at the start of the
> real vmalloc_sync_all() would work fine.

Something like that.  I don't want to redo my patch if we're going to change
your patch ;)

> And I like vmalloc_sync_all() being a non-arch-specific interface; it
> cleans up another of the xen patches.

OK.

> > But I'm a bit reluctant to rework
> > move-die-notifier-handling-to-common-code-fix-vmalloc_sync_all.patch
> > (somehow) until I understand why your patch is a) futzing with non-PAE,
> > non-paravirt code
> 
> There should be no functional difference for non-paravirt code, PAE or
> non-PAE.
> 
> >  and b) overengineered.
> >   
> 
> Overall, or just this bit?

this bit.

> > Why didn't you just stick a
> >
> > 	if (SHARED_KERNEL_PMD)
> > 		return;
> >
> > into vmalloc_sync_all()?
> >   
> 
> That would work, but when building !PARAVIRT && PAE, SHARED_KERNEL_PMD
> is just constant 1, so it would end up making a pointless function
> call.  With the wrapper, the call disappears entirely.  It probably
> doesn't matter, but I didn't want anyone to complain about making the
> !PARAVIRT generated code worse (hi, Ingo!).

vmalloc_sync_all() is a) tremendously slow and b) only called by
register_die_notifier().  We can afford to add a few cycles to it.

> However, if you're making vmalloc_sync_all a weak function anyway, then
> there's no difference with the paravirt patches in place.  The
> 
> 	if (SHARED_KERNEL_PMD)
> 		return;
> 
> will evaluate to
> 
> 	if (1)
> 		return;
> 

  reply	other threads:[~2007-04-07  0:28 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04 19:11 [patch 00/20] paravirt_ops updates Jeremy Fitzhardinge
2007-04-04 19:11 ` [patch 01/20] update MAINTAINERS Jeremy Fitzhardinge
2007-04-04 19:11 ` [patch 02/20] Remove CONFIG_DEBUG_PARAVIRT Jeremy Fitzhardinge
2007-04-04 19:11 ` [patch 03/20] use paravirt_nop to consistently mark no-op operations Jeremy Fitzhardinge
2007-04-04 19:11 ` [patch 04/20] Add pagetable accessors to pack and unpack pagetable entries Jeremy Fitzhardinge
2007-04-04 19:11 ` [patch 05/20] Hooks to set up initial pagetable Jeremy Fitzhardinge
2007-04-04 19:11 ` [patch 06/20] Allocate a fixmap slot Jeremy Fitzhardinge
2007-04-04 19:11 ` [patch 07/20] Allow paravirt backend to choose kernel PMD sharing Jeremy Fitzhardinge
2007-04-05  0:30   ` Christoph Lameter
2007-04-05  0:43     ` Jeremy Fitzhardinge
2007-04-05  1:29     ` Chris Wright
2007-04-06 23:41   ` Andrew Morton
2007-04-07  0:02     ` Jeremy Fitzhardinge
2007-04-07  0:28       ` Andrew Morton [this message]
2007-04-07  0:40         ` Jeremy Fitzhardinge
2007-04-07  1:21           ` Andrew Morton
2007-04-07  5:47             ` Jeremy Fitzhardinge
2007-04-09  2:36         ` William Lee Irwin III
2007-04-04 19:11 ` [patch 08/20] add hooks to intercept mm creation and destruction Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 09/20] rename struct paravirt_patch to paravirt_patch_site for clarity Jeremy Fitzhardinge
2007-04-06 23:18   ` Andrew Morton
2007-04-06 23:24     ` Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 10/20] Use patch site IDs computed from offset in paravirt_ops structure Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 11/20] Fix patch site clobbers to include return register Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 12/20] Consistently wrap paravirt ops callsites to make them patchable Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 13/20] Document asm-i386/paravirt.h Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 14/20] add common patching machinery Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 15/20] add flush_tlb_others paravirt_op Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 16/20] revert map_pt_hook Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 17/20] add kmap_atomic_pte for mapping highpte pages Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 18/20] clean up tsc-based sched_clock Jeremy Fitzhardinge
2007-04-06 23:22   ` Andrew Morton
2007-04-06 23:27     ` Jeremy Fitzhardinge
2007-04-06 23:45       ` Andrew Morton
2007-04-06 23:40     ` Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 19/20] Add a sched_clock paravirt_op Jeremy Fitzhardinge
2007-04-04 19:12 ` [patch 20/20] Add apply_to_page_range() which applies a function to a pte range Jeremy Fitzhardinge
2007-04-05  4:41   ` Matt Mackall
2007-04-05  6:52     ` Jeremy Fitzhardinge
2007-04-17 20:56       ` Matt Mackall
2007-04-19 19:44         ` Jeremy Fitzhardinge
2007-04-19 19:59           ` Matt Mackall
2007-04-19 21:37             ` Jeremy Fitzhardinge
2007-04-19 21:30               ` Matt Mackall
2007-04-19 22:30                 ` Jeremy Fitzhardinge

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=20070406172844.12f7b8e7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ak@suse.de \
    --cc=clameter@sgi.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=virtualization@lists.osdl.org \
    --cc=wli@holomorphy.com \
    --cc=zach@vmware.com \
    /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;
as well as URLs for NNTP newsgroup(s).