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

Re: [tyndur-devel] [PATCH v2 7/7] kernel2: Page Directories seltener kopieren



On Sun, Jan 03 17:03, Kevin Wolf wrote:
> ! kernel2: Page Directories muessen nur neu kopiert werden, wenn sie
>   sich auch tatsaechlich geaendert haben. Wenn sich nur eine Page Table
>   geaendert hat, ist das nicht noetig.
> 
> Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
> ---
>  src/kernel2/src/arch/i386/mm/mm_context.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/src/kernel2/src/arch/i386/mm/mm_context.c b/src/kernel2/src/arch/i386/mm/mm_context.c
> index e4eb79b..20edcfa 100644
> --- a/src/kernel2/src/arch/i386/mm/mm_context.c
> +++ b/src/kernel2/src/arch/i386/mm/mm_context.c
> @@ -289,6 +289,13 @@ static bool map_page
>          // An dieser Stelle kann die Page Table noch nicht initialisiert
>          // werden, weil sie noch nicht gemappt ist.
>          clear_page_table = TRUE;
> +
> +        if (((uintptr_t) vaddr >= KERNEL_MEM_START) && ((uintptr_t) vaddr <
> +            KERNEL_MEM_END))
> +        {
> +            context->version = ++page_directory_version;
> +            page_directory_current = context->page_directory_virt;
> +        }
>      } 
>      else if (page_directory[vpage / PAGE_TABLE_LENGTH] & PTE_PS) 
>      {
> @@ -343,13 +350,6 @@ static bool map_page
>          } else {
>              mmc_unmap(&mmc_current_context(), page_table, 1);
>          }
> -        
> -        if (((uintptr_t) vaddr >= KERNEL_MEM_START) && ((uintptr_t) vaddr <
> -            KERNEL_MEM_END))
> -        {
> -            context->version = ++page_directory_version;
> -            page_directory_current = context->page_directory_virt;
> -        }
>          unlock(&context->lock);
>          return TRUE;
>      }

Acked-by: Antoine Kaufmann <toni@xxxxxxxxxx>

-- 
Antoine Kaufmann
<toni@xxxxxxxxxxxxxxxx>

Attachment: pgpca8VmBkqY1.pgp
Description: PGP signature