From: Manfred Spraul <manfreds@colorfullife.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kanoj Sarcar <kanoj@google.engr.sgi.com>,
sct@redhat.com, andrea@suse.de, viro@math.psu.edu,
linux-mm@kvack.org, linux-kernel@vger.rutgers.edu
Subject: Re: [PATCH] kanoj-mm17-2.3.21 kswapd vma scanning protection
Date: Sat, 16 Oct 1999 01:16:10 +0200 [thread overview]
Message-ID: <3807B5BA.151F676B@colorfullife.com> (raw)
In-Reply-To: <Pine.LNX.4.10.9910151417360.852-100000@penguin.transmeta.com>
Linus Torvalds wrote:
>
> .. hold a spinlock - we can probably just reuse the
> page_table_lock for this to avoid multiple levels of locking
> here..
>
> file = fget(vma->vm_file);
^^^^^^^
> offset = file->f_offset + (address - vma->vm_start);
> flush_tlb_page(vma, address);
> spin_unlock(&vma->vm_mm->page_table_lock);
>
> error = file->f_ops->swapout(file, offset, page);
> fput(file);
>
> ...
>
> and then the other requirement would be that whenever the vma chain is
> physically modified, you also have to hold the page_table_lock.
>
What about shm? vma->vm_file is NULL, this would oops.
I think that both "prepare for possible vma removal" and the parameters
which are passed to ->swapout() should be vma-specific: what about a
vm_ops->swapprepare()? This function should not allocate memory, ie
parameter passing should be stack based:
<<<<< mm.h
struct private_data
{
void* private[4];
};
struct vm_ops
{
...
void (*swapprepare)(struct vm_area_struct * vma, struct page * page,
struct private_data * info);
void (*swapout)(struct private_data * info, struct page* page);
...
};
>>>>>>>>>
<<<<<<<< vmscan.c
if(vma->vm_ops && vma->vm_ops->swapout) {
int error;
struct private_data info;
void (*swapout)(...);
pte_clear(page_table);
swapout = vma->vm_ops->swapout;
vma->vm_ops->swapprepare(vma,page,&info);
spin_unlock(page_table_lock);
flush_tlb_page();
error = swapout(&info,page);
...
}
>>>>>>>>>>>>>>>>
--
Manfred
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/
next prev parent reply other threads:[~1999-10-15 23:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-15 0:06 Kanoj Sarcar
1999-10-15 11:58 ` Manfred Spraul
1999-10-15 16:38 ` Kanoj Sarcar
1999-10-15 18:26 ` Manfred Spraul
1999-10-15 18:43 ` Kanoj Sarcar
1999-10-15 20:47 ` Manfred Spraul
1999-10-15 21:13 ` Kanoj Sarcar
1999-10-15 21:24 ` Linus Torvalds
1999-10-15 21:39 ` Kanoj Sarcar
1999-10-15 22:04 ` Linus Torvalds
1999-10-15 22:32 ` Kanoj Sarcar
1999-10-15 23:16 ` Manfred Spraul [this message]
1999-10-16 0:44 ` Linus Torvalds
1999-10-18 19:45 ` Kanoj Sarcar
1999-10-18 20:02 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3807B5BA.151F676B@colorfullife.com \
--to=manfreds@colorfullife.com \
--cc=andrea@suse.de \
--cc=kanoj@google.engr.sgi.com \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=sct@redhat.com \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox