[OpenAFS-devel] Re: Inconsistency on Linux-S390

jacobi@de.ibm.com jacobi@de.ibm.com
Mon, 26 Mar 2001 19:18:34 +0200



Ok, I have located the spot! Here it is:
src/afs/LINUX/osi_module.c;69:

int init_module(void)
{
    extern int afs_syscall();
    extern int afs_xsetgroups();
#ifdef AFS_SPARC64_LINUX20_ENV
    extern int afs_xsetgroups32();
#endif

    /* obtain PAGE_OFFSET value */
    afs_linux_page_offset = get_page_offset();
+    printk (KERN_DEBUG "The page offset is set to %lx\n",
afs_linux_page_offset);
+  /* The result is 0x7fffffff */
+
+    /* This may crash, but it is just a little test ... */
+    afs_linux_page_offset = 0x80000000;

    if (afs_linux_page_offset == 0) {
        /* couldn't obtain page offset so can't continue */
        printf("afs: Unable to obtain PAGE_OFFSET. Exiting..");
        return -EIO;
    }
[...]

So when the module is inited he tries to find the start of the page cache,
I guess.
When he calls the conventional "get_page_offset" he gets 0x7fffffff ...
which
sounded very dubious to me. So I made a round number out of it and see
there,
I don't have the one-byte-shift at the beginning of my files.
Now I took a look at "get_page_offset":

static long get_page_offset(void)
{
#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) ||
defined(AFS_SPARC_LINUX20_ENV)
    return PAGE_OFFSET;

/* Ok, I wouldn't insert LINUX_S390 in here since "PAGE_OFFSET" is set to
0x0 which will cause
AFS to cancel */

#else
    struct task_struct *p;

    /* search backward thru the circular list */
    for(p = current; p; p = p->prev_task)
     if (p->pid == 1)
         return p->addr_limit.seg;

    return 0;
#endif
}

As far as I understand this function he searches the process list until he
finds "init" and then
guesses, that the addr_limit.seg of init is also the beginning of the
page-cache area.
This may be suitable for Linux-x86, but for LINUX-s390 you get this
one-byte-error.
So my suggestion would be to make a temporary preprocessor workaround that
sets a constant
PAGE_OFFSET of 0x80000000 for S390-32bit environments, and find a different
 mean
for a general evaluation of the PAGE_OFFSET ... I will also speak to the
S390-Linux
developers. Maybe they have a clue what is a valid method to find out
PAGE_OFFSET
on all Linux platforms. So long ...

Carsten Jacobi