Messages in this thread | | | Date | Wed, 18 Oct 2000 04:00:10 +0100 | From | Stephen Tweedie <> | Subject | Re: mapping user space buffer to kernel address space |
| |
Hi,
On Wed, Oct 18, 2000 at 01:00:48AM +0200, Andrea Arcangeli wrote: > On Tue, Oct 17, 2000 at 02:04:10PM -0700, Linus Torvalds wrote: > > It so happens that the vmscan stuff won't ever remove a physical page > > mapping, but that's simply because such a page CANNOT be swapped out. How > > So if I write a mechanism that allows those driver-private-pages that are used > for DMA of a soundcard to be swapped out, then you would remove the > PG_referenced bitflag from them too?
Are you sure you don't mean PG_Reserved?
If they get removed from the process's working set, then sure --- why not? Why should the driver care? As long as the page is pinned in physical memory (ie. as long as it has a raised page count), the driver won't mind at all. If your vma has a nopage method to reestablish the ptes on page fault, then swap would work fine, just as long as we fix the problem we've already identified about swapout writing pages early rather than once they are finally leaving the swap cache.
It's a completely different matter if you're dealing with ioremap of PCI-aperture pages, but that's mostly because they don't have valid struct page *'s (at least not unless you have 4GB ram).
> What sense it has to start to writeout to disk a page that is under DMA when > you don't know if this page is getting changed under the swapout?
Umm, we've already said that we want to fix the raw IO problem by setting the page dirty on initial swapout but doing the IO once we know it's only in swap cache. Do that and we won't ever write a swap page that is mapped by any IO subsystem.
--Stephen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
| |