bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] vm: make struct vm_map fit into a cache line


From: Samuel Thibault
Subject: Re: [PATCH 2/2] vm: make struct vm_map fit into a cache line
Date: Thu, 1 May 2014 01:08:40 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, le Wed 30 Apr 2014 21:10:47 +0200, a écrit :
> Currently, the size of struct vm_map is 68 bytes.  By using a bit
> field for the boolean flags, it can be made fit into a cache line.

Ack.

> * vm/vm_map.h (struct vm_map): Use a bit field for the boolean flags
> wait_for_space and wiring_required.
> ---
>  vm/vm_map.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/vm/vm_map.h b/vm/vm_map.h
> index b6bc177..b8103eb 100644
> --- a/vm/vm_map.h
> +++ b/vm/vm_map.h
> @@ -175,9 +175,12 @@ struct vm_map {
>       vm_map_entry_t          hint;           /* hint for quick lookups */
>       decl_simple_lock_data(, hint_lock)      /* lock for hint storage */
>       vm_map_entry_t          first_free;     /* First free space hint */
> -     boolean_t               wait_for_space; /* Should callers wait
> +
> +     /* Flags */
> +     unsigned int    wait_for_space:1,       /* Should callers wait
>                                                  for space? */
> -     boolean_t               wiring_required;/* All memory wired? */
> +     /* boolean_t */ wiring_required:1;      /* All memory wired? */
> +
>       unsigned int            timestamp;      /* Version number */
>  };
>  
> -- 
> 1.9.2
> 

-- 
Samuel
Hi ! I'm a .signature virus ! Copy me into your ~/.signature, please !



reply via email to

[Prev in Thread] Current Thread [Next in Thread]