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

Liang Yang <[email protected]>
Newsgroups gmane.network.tux
Message-ID <[email protected]>
Hi, Ingo

I'm so glad to receive your reply. We're graduate students of Arizona
State University. We're not familiar with Linux kernel and although we
spend a lot of time on Linux and TUX,  we still don't make much progress.
We encounter some technical problems which we can's solve. We worry
about it too much and please help us. We really need your help.

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.

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.


Second, can we use path_walk directly in our user-space modules and how to
use it in user-space modules?
We find we need pass two parameters to path_walk, once is *req, the other is
base. But after read input.c, it seems path_walk only accpet tux_req_t
instead of
user_req_t since we need to assign base structure using the fields value in
tux_req_t,
but we can't find the same fields in the user_req_t. While tux_req_t is not
available in
user-space modules, we can only use user_req_t.

Third, when we changed the source code of TUX, can we build TUX.o seperately
to
make if effect instead of building all Linux kernel modules. When we try to
use the make in /usr/src/linux-2.4.9-31/net/tux, we encounter some problems:

Make report: " Rules.make not found"

Then I sepcify TOPDIR in the Makefile and build TUX again, this time
I got a different error as follows:

make[1]: Entering directory `/usr/src/linux-2.4.9-31/net/tux'
cc    -c -o accept.o accept.c
accept.c:9:21: net/tux.h: No such file or directory
make[1]: *** [accept.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.9-31/net/tux'
make: *** [first_rule] Error 2c:9:21: net/tux.h: No such file or directory

I found Linux kernel can build TUX module correctly when I rebuild
Linux kernel successfully. So maybe something wrong with the TUX Makefile
configuration when I use it seperately,but I don't know the reason.

Thank you.

Liang

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf
Of Ingo Molnar
Sent: Tuesday, April 02, 2002 6:23 AM
To: [email protected]
Subject: Re: How can TUX user module get notified when a page is removed
from cache?



On Thu, 28 Mar 2002, Liang Yang wrote:

> We can use path_walk() to query Linux kernel file system whether a
> specific file is in the memory cache or not, but now we want our TUX
> user space module to get notified regularly from Linux kernel when a
> page is removed from memory cache or a page is added to the memory
> cache? The purpose of this is we try to maintain a table in user module
> to record the status of files which are once accessed. It seems we need
> to install a callback function in TUX user module for this event. How
> can we do that?

could you tell us a bit more about why such a callback is needed?

> BTW, which function can we use to get the information of all cached
> files in Linux kernel so that we can know which files are cached
> currently?

it might be possible to just look at whether the dentry is cached or not.
Ie. call path_walk with the atomic-lookup bit set, and if it returns a
dentry then the file is 'cached'.

but as long as contents go, a file might be not cached or partially cached
or fully cached. There is no easily accessible information about this -
the pagecache is transparent to TUX.

	Ingo



_______________________________________________
tux-list mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/tux-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.