[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.00.0801181214440.2957@woody.linux-foundation.org>
Date: Fri, 18 Jan 2008 12:22:25 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Anton Salikhmetov <salikhmetov@...il.com>
cc: Miklos Szeredi <miklos@...redi.hu>, peterz@...radead.org,
linux-mm@...ck.org, jakob@...hought.net,
linux-kernel@...r.kernel.org, valdis.kletnieks@...edu,
riel@...hat.com, ksm@...dk, staubach@...hat.com,
jesper.juhl@...il.com, akpm@...ux-foundation.org,
protasnb@...il.com, r.e.wolff@...wizard.nl,
hidave.darkstar@...il.com, hch@...radead.org
Subject: Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped
files
On Fri, 18 Jan 2008, Anton Salikhmetov wrote:
>
> The current solution doesn't hit the performance at all when compared to
> the competitor POSIX-compliant systems. It is faster and does even more
> than the POSIX standard requires.
Your current patches have two problems:
- they are simply unnecessarily invasive for a relatively simple issue
- all versions I've looked at closer are buggy too
Example:
+ if (pte_dirty(*pte) && pte_write(*pte))
+ *pte = pte_wrprotect(*pte);
Uhhuh. Looks simple enough. Except it does a non-atomic pte access while
other CPU's may be accessing it and updating it from their hw page table
walkers. What will happen? Who knows? I can see lost access bits at a
minimum.
IOW, this isn't simple code. It's code that it is simple to screw up. In
this case, you really need to use ptep_set_wrprotect(), for example.
So why not do it in many fewer lines with that simpler vma->dirty flag?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists