linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: clean up pgd_{c,d}tor
@ 2008-07-18 12:47 Jan Beulich
  2008-07-18 14:52 ` Jeremy Fitzhardinge
  2008-07-18 23:15 ` H. Peter Anvin
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Beulich @ 2008-07-18 12:47 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: linux-kernel

Giving pgd_ctor() a properly typed parameter allows eliminating a local
variable. Adjust pgd_dtor() to match.

Also, pgd_ctor()'s clearing of the memory is redundant with the
GFP_ZERO used for allocating it.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 arch/x86/mm/pgtable.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- linux-2.6.26/arch/x86/mm/pgtable.c	2008-07-13 23:51:29.000000000 +0200
+++ 2.6.26-x86-pgd-alloc-cleanup/arch/x86/mm/pgtable.c	2008-06-25 14:35:40.000000000 +0200
@@ -62,14 +62,10 @@ static inline void pgd_list_del(pgd_t *p
 #define UNSHARED_PTRS_PER_PGD				\
 	(SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)
 
-static void pgd_ctor(void *p)
+static void pgd_ctor(pgd_t *pgd)
 {
-	pgd_t *pgd = p;
 	unsigned long flags;
 
-	/* Clear usermode parts of PGD */
-	memset(pgd, 0, KERNEL_PGD_BOUNDARY*sizeof(pgd_t));
-
 	spin_lock_irqsave(&pgd_lock, flags);
 
 	/* If the pgd points to a shared pagetable level (either the
@@ -94,7 +90,7 @@ static void pgd_ctor(void *p)
 	spin_unlock_irqrestore(&pgd_lock, flags);
 }
 
-static void pgd_dtor(void *pgd)
+static void pgd_dtor(pgd_t *pgd)
 {
 	unsigned long flags; /* can be called from interrupt context */
 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: clean up pgd_{c,d}tor
  2008-07-18 12:47 [PATCH] x86: clean up pgd_{c,d}tor Jan Beulich
@ 2008-07-18 14:52 ` Jeremy Fitzhardinge
  2008-07-18 15:23   ` Jan Beulich
  2008-07-18 23:15 ` H. Peter Anvin
  1 sibling, 1 reply; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2008-07-18 14:52 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, hpa, linux-kernel

Jan Beulich wrote:
> Giving pgd_ctor() a properly typed parameter allows eliminating a local
> variable. Adjust pgd_dtor() to match.
>
> Also, pgd_ctor()'s clearing of the memory is redundant with the
> GFP_ZERO used for allocating it.
>   

Ack to the parameter type change.  But there's already a patch in git to 
remove the redundant clear.

    J

> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
> ---
>  arch/x86/mm/pgtable.c |    8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> --- linux-2.6.26/arch/x86/mm/pgtable.c	2008-07-13 23:51:29.000000000 +0200
> +++ 2.6.26-x86-pgd-alloc-cleanup/arch/x86/mm/pgtable.c	2008-06-25 14:35:40.000000000 +0200
> @@ -62,14 +62,10 @@ static inline void pgd_list_del(pgd_t *p
>  #define UNSHARED_PTRS_PER_PGD				\
>  	(SHARED_KERNEL_PMD ? KERNEL_PGD_BOUNDARY : PTRS_PER_PGD)
>  
> -static void pgd_ctor(void *p)
> +static void pgd_ctor(pgd_t *pgd)
>  {
> -	pgd_t *pgd = p;
>  	unsigned long flags;
>  
> -	/* Clear usermode parts of PGD */
> -	memset(pgd, 0, KERNEL_PGD_BOUNDARY*sizeof(pgd_t));
> -
>  	spin_lock_irqsave(&pgd_lock, flags);
>  
>  	/* If the pgd points to a shared pagetable level (either the
> @@ -94,7 +90,7 @@ static void pgd_ctor(void *p)
>  	spin_unlock_irqrestore(&pgd_lock, flags);
>  }
>  
> -static void pgd_dtor(void *pgd)
> +static void pgd_dtor(pgd_t *pgd)
>  {
>  	unsigned long flags; /* can be called from interrupt context */
>  
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>   


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: clean up pgd_{c,d}tor
  2008-07-18 14:52 ` Jeremy Fitzhardinge
@ 2008-07-18 15:23   ` Jan Beulich
  2008-07-18 16:08     ` Jeremy Fitzhardinge
  2008-07-18 16:15     ` Jeremy Fitzhardinge
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Beulich @ 2008-07-18 15:23 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: mingo, tglx, linux-kernel, hpa

>>> Jeremy Fitzhardinge <jeremy@goop.org> 18.07.08 16:52 >>>
>Jan Beulich wrote:
>> Giving pgd_ctor() a properly typed parameter allows eliminating a local
>> variable. Adjust pgd_dtor() to match.
>>
>> Also, pgd_ctor()'s clearing of the memory is redundant with the
>> GFP_ZERO used for allocating it.
>>   
>
>Ack to the parameter type change.  But there's already a patch in git to 
>remove the redundant clear.

Again, I can't see this in my just refreshed tree - am I doing things wrong?
Or is this due to the myriads of topic branches (which of course I don't
check out all)?

Jan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: clean up pgd_{c,d}tor
  2008-07-18 15:23   ` Jan Beulich
@ 2008-07-18 16:08     ` Jeremy Fitzhardinge
  2008-07-18 16:15     ` Jeremy Fitzhardinge
  1 sibling, 0 replies; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2008-07-18 16:08 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, linux-kernel, hpa

Jan Beulich wrote:
>>>> Jeremy Fitzhardinge <jeremy@goop.org> 18.07.08 16:52 >>>
>>>>         
>> Jan Beulich wrote:
>>     
>>> Giving pgd_ctor() a properly typed parameter allows eliminating a local
>>> variable. Adjust pgd_dtor() to match.
>>>
>>> Also, pgd_ctor()'s clearing of the memory is redundant with the
>>> GFP_ZERO used for allocating it.
>>>   
>>>       
>> Ack to the parameter type change.  But there's already a patch in git to 
>> remove the redundant clear.
>>     
>
> Again, I can't see this in my just refreshed tree - am I doing things wrong?
> Or is this due to the myriads of topic branches (which of course I don't
> check out all)?
>   

No, the changes are in mainline linux-2.6.git, though you should be able 
to find them in master in tip.git.

    J


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: clean up pgd_{c,d}tor
  2008-07-18 15:23   ` Jan Beulich
  2008-07-18 16:08     ` Jeremy Fitzhardinge
@ 2008-07-18 16:15     ` Jeremy Fitzhardinge
  1 sibling, 0 replies; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2008-07-18 16:15 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, linux-kernel, hpa

Jan Beulich wrote:
> Again, I can't see this in my just refreshed tree - am I doing things wrong?
> Or is this due to the myriads of topic branches (which of course I don't
> check out all)?
>   

Oh, are you still looking in x86.git?  I don't think that's being 
updated any more.
http://people.redhat.com/mingo/tip.git/readme.txt

    J


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86: clean up pgd_{c,d}tor
  2008-07-18 12:47 [PATCH] x86: clean up pgd_{c,d}tor Jan Beulich
  2008-07-18 14:52 ` Jeremy Fitzhardinge
@ 2008-07-18 23:15 ` H. Peter Anvin
  1 sibling, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2008-07-18 23:15 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, linux-kernel

Jan Beulich wrote:
> Giving pgd_ctor() a properly typed parameter allows eliminating a local
> variable. Adjust pgd_dtor() to match.
> 
> Also, pgd_ctor()'s clearing of the memory is redundant with the
> GFP_ZERO used for allocating it.

This patch appears stale.

	-hpa

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-18 23:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 12:47 [PATCH] x86: clean up pgd_{c,d}tor Jan Beulich
2008-07-18 14:52 ` Jeremy Fitzhardinge
2008-07-18 15:23   ` Jan Beulich
2008-07-18 16:08     ` Jeremy Fitzhardinge
2008-07-18 16:15     ` Jeremy Fitzhardinge
2008-07-18 23:15 ` H. Peter Anvin

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).