[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
  Web www.spinics.net

RE: How can TUX user module get notified when a page is removed from cache?

Hi, Ingo

Thanks for your encouragement.

We find TUX can improve the performance to the static files
request greatly. It almost save 50% time compared with Apache
when we access a 50MB HTML file.


-----Original Message-----
From: tux-list-admin@redhat.com [mailto:tux-list-admin@redhat.com]On Behalf
Of Ingo Molnar
Sent: Tuesday, April 02, 2002 7:39 AM
To: TUX Development Mailing List
Cc: Liang Yang
Subject: RE: How can TUX user module get notified when a page is removed
from cache?

On Tue, 2 Apr 2002, Liang Yang wrote:

> Here is the idea of our work. We need to query the caching status of
> files and notify the front end(a proxy) dynamically, so the proxy know
> in which backend server the user requested file is still cached and the
> proxy will only forward the user request to that machine which still
> keep the file in cache. If both the backend machines still cache the
> file, the proxy will select one randomly.  To simplify our model, now we
> don't need such kind of callback functions to be notified by Linux
> kernel which files is discarded, we will issue our request to query the
> file caching status in our user-space module.

ok, this scheme makes sense.

> We have some questions:
> First, if we call path_walk with atomic-lookup bit set and it returns a
> dentry, we know this file is 'cached'. But you say a file may be
> partially cached, so does path_walk still return a dentry when a file is
> partially cached.

yes. I'd suggest the following solution: extend the TUX module API with a
new call like TUX_ACTION_OBJECT_CACHED. This will be a transparent method
to tell whether the file is cached by this particular node or not.

on the kernel side i'd suggest for you to do an atomic lookup, and if it
succeeds, look up the first page of the file, by doing an atomic
(nonblocking) 1-byte do_generic_file_read. This is atomic and has low

for 99% of the cases if the first byte of the file is cached then the
whole file is cached. You can still extend this mechanizm to look at
intermediate pages as well, if it becomes a practical issue anytime in the
future, your userspace module will not be affected by this.

[feel free to send me an email if you have trouble implementing this.]

> Second, can we use path_walk directly in our user-space modules and how
> to use it in user-space modules?

i'd suggest to provide the above TUX action, because this is a
functionality that is not sufficiently represented in the current Linux
API. So while it might be possible to look a file name up atomically from
userspace, it's not possible to do the 'is the first byte of the file
cached or not' kind of queries currently.




[Older Fedora Users Mail]     [Home]     [Fedora Legacy]     [Fedora Desktop]     [iPod Nano]     [ATA RAID]     [Fedora Bible]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Packaging]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

Powered by Linux

  Web www.spinics.net