* Question about swap_in() in 2.2.16 ....
@ 2000-11-08 6:32 Shuvabrata Ganguly
2000-11-08 10:05 ` Stephen C. Tweedie
0 siblings, 1 reply; 4+ messages in thread
From: Shuvabrata Ganguly @ 2000-11-08 6:32 UTC (permalink / raw)
To: linux MM
hi,
after the missing page has been swapped in this bit of code is
executed:-
if (!write_access || is_page_shared(page_map)) {
set_pte(page_table, mk_pte(page, vma->vm_page_prot));
return 1;
}
Now this creates a read-only mapping even if the access was a "write
acess" ( if the page is shared ). Doesnt this mean that an additional
"write-protect" fault will be taken immediately when the process tries
to write again ? Or am i missing something here ?
joy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about swap_in() in 2.2.16 ....
2000-11-08 6:32 Question about swap_in() in 2.2.16 Shuvabrata Ganguly
@ 2000-11-08 10:05 ` Stephen C. Tweedie
2000-11-10 4:23 ` Shuvabrata Ganguly
0 siblings, 1 reply; 4+ messages in thread
From: Stephen C. Tweedie @ 2000-11-08 10:05 UTC (permalink / raw)
To: Shuvabrata Ganguly; +Cc: linux MM
Hi,
On Wed, Nov 08, 2000 at 01:32:26AM -0500, Shuvabrata Ganguly wrote:
>
> after the missing page has been swapped in this bit of code is
> executed:-
>
> if (!write_access || is_page_shared(page_map)) {
> set_pte(page_table, mk_pte(page, vma->vm_page_prot));
> return 1;
> }
>
> Now this creates a read-only mapping even if the access was a "write
> acess" ( if the page is shared ). Doesnt this mean that an additional
> "write-protect" fault will be taken immediately when the process tries
> to write again ?
Yes.
Cheers,
Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about swap_in() in 2.2.16 ....
2000-11-08 10:05 ` Stephen C. Tweedie
@ 2000-11-10 4:23 ` Shuvabrata Ganguly
2000-11-10 9:56 ` Stephen C. Tweedie
0 siblings, 1 reply; 4+ messages in thread
From: Shuvabrata Ganguly @ 2000-11-10 4:23 UTC (permalink / raw)
To: Stephen C. Tweedie, linux MM
"Stephen C. Tweedie" wrote:
> Hi,
>
> On Wed, Nov 08, 2000 at 01:32:26AM -0500, Shuvabrata Ganguly wrote:
> >
> > after the missing page has been swapped in this bit of code is
> > executed:-
> >
> > if (!write_access || is_page_shared(page_map)) {
> > set_pte(page_table, mk_pte(page, vma->vm_page_prot));
> > return 1;
> > }
> >
> > Now this creates a read-only mapping even if the access was a "write
> > acess" ( if the page is shared ). Doesnt this mean that an additional
> > "write-protect" fault will be taken immediately when the process tries
> > to write again ?
>
> Yes.
>
Then why dont we give it a private page in the first place ?
Cheers
Joy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about swap_in() in 2.2.16 ....
2000-11-10 4:23 ` Shuvabrata Ganguly
@ 2000-11-10 9:56 ` Stephen C. Tweedie
0 siblings, 0 replies; 4+ messages in thread
From: Stephen C. Tweedie @ 2000-11-10 9:56 UTC (permalink / raw)
To: Shuvabrata Ganguly; +Cc: Stephen C. Tweedie, linux MM
Hi,
On Thu, Nov 09, 2000 at 11:23:05PM -0500, Shuvabrata Ganguly wrote:
> "Stephen C. Tweedie" wrote:
> > > Now this creates a read-only mapping even if the access was a "write
> > > acess" ( if the page is shared ). Doesnt this mean that an additional
> > > "write-protect" fault will be taken immediately when the process tries
> > > to write again ?
> >
> > Yes.
>
> Then why dont we give it a private page in the first place ?
Normal copy-on-write is an extremely performance-critical code path.
It's really not worth the trouble of adding extra code to it to make
the swapin page fault do the same copy-on-write immediately, because
swapin simply is not that important for performance.
--Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-11-10 9:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-08 6:32 Question about swap_in() in 2.2.16 Shuvabrata Ganguly
2000-11-08 10:05 ` Stephen C. Tweedie
2000-11-10 4:23 ` Shuvabrata Ganguly
2000-11-10 9:56 ` Stephen C. Tweedie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox