Re: [RFC 3/6] mm: mark dirty bit on swapped-in page

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

 



On Wed, Jun 10, 2015 at 05:00:35PM +0900, Minchan Kim wrote:
> > 
> > Ah, I recall. If there is no way to escape dirtifying the page in pte itself
> > maybe we should at least not make it softdirty on read faults?
> 
> You mean this? 
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index e1c45d0..c95340d 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -2557,9 +2557,14 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
>  
>         inc_mm_counter_fast(mm, MM_ANONPAGES);
>         dec_mm_counter_fast(mm, MM_SWAPENTS);
> -       pte = mk_pte(page, vma->vm_page_prot);
> +
> +       /* Mark dirty bit of page table because MADV_FREE relies on it */
> +       pte = pte_mkdirty(mk_pte(page, vma->vm_page_prot));
> +       if (!flgas & FAULT_FLAG_WRITE)
> +               pte = pte_clear_flags(pte, _PAGE_SOFT_DIRTY)
> +
>         if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) {
> -               pte = maybe_mkwrite(pte_mkdirty(pte), vma);
> +               pte = maybe_mkwrite(pte, vma);
>                 flags &= ~FAULT_FLAG_WRITE;
>                 ret |= VM_FAULT_WRITE;
>                 exclusive = 1;
> 
> It could be doable if everyone doesn't have strong objection
> on this patchset.
> 
> I will wait more review.

Yeah, something like this. Lets wait for opinions, thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]