Linux MIPS Architecture development
 help / color / mirror / Atom feed
* RAMDISK problem on 79s334A board.
@ 2002-05-15  8:42 Venkata Rajesh Bikkina
  2002-05-15 11:00 ` Alan Cox
  0 siblings, 1 reply; 9+ messages in thread
From: Venkata Rajesh Bikkina @ 2002-05-15  8:42 UTC (permalink / raw)
  To: linux-mips


Hi All,

I am working on 79s334A board with 32MB RAM and Linux 2.4.13 kernel. 
I have module to be inserted into kernel. The size of the module will be
around 1 MB.
I am using two file systems while building kernel image, one is NFS and
the other is RAMDISK.
When i work with NFS i do not have any problem.

But when i build RAMDISK image and insert the module, insmod is
doing fine. But after that i could not invoke any other application ( even
ps -ef is also giving segmentation fault.)
The RAMDISK size choosen is 10MB and the memory on board is 32MB.
When i did cat /proc/meminfo i found strange thing. All the figures are
corrupted.

The statistics before and after insmod are as follows:

# cat /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  29237248 15319040 13918208        0 10240000  2908160
Swap:        0        0        0
MemTotal:        28552 kB
MemFree:         13592 kB
MemShared:           0 kB
Buffers:         10000 kB
Cached:           2840 kB
Active:          12840 kB
Inact_dirty:         0 kB
Inact_clean:         0 kB
Inact_target:       44 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:        28552 kB
LowFree:         13592 kB
SwapTotal:           0 kB
SwapFree:            0 kB
#
#
# cd /igateway
# /sbin/insmod igateway
Intoto Firewall Installed.
#
#
# /sbin/lsmod
Module                  Size  Used by
igateway              967056   0 (unused)
#
#
# cat /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  %8lu %8lu %8lu %8lu %8lu %8u
Swap: %8lu %8lu %8lu
MemTotal:     %8lu kB
MemFree:      %8lu kB
MemShared:    %8lu kB
Buffers:      %8lu kB
Cached:       %8u kB
Active:       %8u kB
Inact_dirty:  %8u kB
Inact_clean:  %8u kB
Inact_target: %8lu kB
HighTotal:    %8lu kB
HighFree:     %8lu kB
LowTotal:     %8lu kB
LowFree:      %8lu kB
SwapTotal:    %8lu kB
SwapFree:     %8lu kB
#
#
# ps -ef
  PID  Uid      Gid State Command
Segmentation fault
# 

Can anybody give hint what is happening. 

Thanks and Regards,
--Rajesh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-15  8:42 RAMDISK problem on 79s334A board Venkata Rajesh Bikkina
@ 2002-05-15 11:00 ` Alan Cox
  2002-05-15 11:00   ` Alan Cox
  2002-05-15 12:00   ` Venkata Rajesh Bikkina
  0 siblings, 2 replies; 9+ messages in thread
From: Alan Cox @ 2002-05-15 11:00 UTC (permalink / raw)
  To: Venkata Rajesh Bikkina; +Cc: linux-mips

> But when i build RAMDISK image and insert the module, insmod is
> doing fine. But after that i could not invoke any other application ( even
> ps -ef is also giving segmentation fault.)

Looks like your module corrupts the kernel.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-15 11:00 ` Alan Cox
@ 2002-05-15 11:00   ` Alan Cox
  2002-05-15 12:00   ` Venkata Rajesh Bikkina
  1 sibling, 0 replies; 9+ messages in thread
From: Alan Cox @ 2002-05-15 11:00 UTC (permalink / raw)
  To: Venkata Rajesh Bikkina; +Cc: linux-mips

> But when i build RAMDISK image and insert the module, insmod is
> doing fine. But after that i could not invoke any other application ( even
> ps -ef is also giving segmentation fault.)

Looks like your module corrupts the kernel.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-15 11:00 ` Alan Cox
  2002-05-15 11:00   ` Alan Cox
@ 2002-05-15 12:00   ` Venkata Rajesh Bikkina
  2002-05-15 13:28     ` Alan Cox
  1 sibling, 1 reply; 9+ messages in thread
From: Venkata Rajesh Bikkina @ 2002-05-15 12:00 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-mips


Hi Alan,

Thankyou for your response.

But the same module is working fine and kernel is also fine if i use NFS
and insert the module.
Any further info ?

--Rajesh

On Wed, 15 May 2002, Alan Cox wrote:

> > But when i build RAMDISK image and insert the module, insmod is
> > doing fine. But after that i could not invoke any other application ( even
> > ps -ef is also giving segmentation fault.)
> 
> Looks like your module corrupts the kernel.
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-15 12:00   ` Venkata Rajesh Bikkina
@ 2002-05-15 13:28     ` Alan Cox
  2002-05-15 13:28       ` Alan Cox
  2002-05-16  8:52       ` Tommy S. Christensen
  0 siblings, 2 replies; 9+ messages in thread
From: Alan Cox @ 2002-05-15 13:28 UTC (permalink / raw)
  To: Venkata Rajesh Bikkina; +Cc: Alan Cox, linux-mips

> But the same module is working fine and kernel is also fine if i use NFS
> and insert the module.
> Any further info ?

Not really. The fact it works with NFS and not ramdisk may simply be that
in one case it corrupts memory that is used, and the other it corrupts
memory that isnt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-15 13:28     ` Alan Cox
@ 2002-05-15 13:28       ` Alan Cox
  2002-05-16  8:52       ` Tommy S. Christensen
  1 sibling, 0 replies; 9+ messages in thread
From: Alan Cox @ 2002-05-15 13:28 UTC (permalink / raw)
  To: Venkata Rajesh Bikkina; +Cc: Alan Cox, linux-mips

> But the same module is working fine and kernel is also fine if i use NFS
> and insert the module.
> Any further info ?

Not really. The fact it works with NFS and not ramdisk may simply be that
in one case it corrupts memory that is used, and the other it corrupts
memory that isnt

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-15 13:28     ` Alan Cox
  2002-05-15 13:28       ` Alan Cox
@ 2002-05-16  8:52       ` Tommy S. Christensen
  2002-05-16 10:22         ` Venkata Rajesh Bikkina
  1 sibling, 1 reply; 9+ messages in thread
From: Tommy S. Christensen @ 2002-05-16  8:52 UTC (permalink / raw)
  To: Venkata Rajesh Bikkina; +Cc: Alan Cox, linux-mips

Alan Cox wrote:
> 
> > But the same module is working fine and kernel is also fine if i use NFS
> > and insert the module.
> > Any further info ?
> 
> Not really. The fact it works with NFS and not ramdisk may simply be that
> in one case it corrupts memory that is used, and the other it corrupts
> memory that isnt

Using a ramdisk increases the pressure on memory. So the difference could
be that one case hits the cache aliasing problem, the other doesn't.

Try this patch and see if it helps.

 -Tommy



Index: mm/vmalloc.c
===================================================================
RCS file: /cvs/linux/mm/vmalloc.c,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -r1.28 -r1.28.2.1
--- mm/vmalloc.c        2001/10/19 01:25:06     1.28
+++ mm/vmalloc.c        2001/12/28 21:06:01     1.28.2.1
@@ -163,6 +163,7 @@
                ret = 0;
        } while (address && (address < end));
        spin_unlock(&init_mm.page_table_lock);
+       flush_cache_all();
        return ret;
 }

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-16  8:52       ` Tommy S. Christensen
@ 2002-05-16 10:22         ` Venkata Rajesh Bikkina
  2002-05-16 12:30           ` Tommy S. Christensen
  0 siblings, 1 reply; 9+ messages in thread
From: Venkata Rajesh Bikkina @ 2002-05-16 10:22 UTC (permalink / raw)
  To: Tommy S. Christensen; +Cc: Alan Cox, linux-mips


Hi Tommy,

I am using 2.4.3 code and in that linux/mm/vmallo.c contains the following
code which is slightly different from the patch you gave.

        } while (address && (address < end));
        unlock_kernel();
        flush_tlb_all();
        return ret;

Can you please suggest how to modify this.

Regards,
--Rajesh

On Thu, 16 May 2002, Tommy S. Christensen wrote:

> Alan Cox wrote:
> > 
> > > But the same module is working fine and kernel is also fine if i use NFS
> > > and insert the module.
> > > Any further info ?
> > 
> > Not really. The fact it works with NFS and not ramdisk may simply be that
> > in one case it corrupts memory that is used, and the other it corrupts
> > memory that isnt
> 
> Using a ramdisk increases the pressure on memory. So the difference could
> be that one case hits the cache aliasing problem, the other doesn't.
> 
> Try this patch and see if it helps.
> 
>  -Tommy
> 
> 
> 
> Index: mm/vmalloc.c
> ===================================================================
> RCS file: /cvs/linux/mm/vmalloc.c,v
> retrieving revision 1.28
> retrieving revision 1.28.2.1
> diff -u -r1.28 -r1.28.2.1
> --- mm/vmalloc.c        2001/10/19 01:25:06     1.28
> +++ mm/vmalloc.c        2001/12/28 21:06:01     1.28.2.1
> @@ -163,6 +163,7 @@
>                 ret = 0;
>         } while (address && (address < end));
>         spin_unlock(&init_mm.page_table_lock);
> +       flush_cache_all();
>         return ret;
>  }
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RAMDISK problem on 79s334A board.
  2002-05-16 10:22         ` Venkata Rajesh Bikkina
@ 2002-05-16 12:30           ` Tommy S. Christensen
  0 siblings, 0 replies; 9+ messages in thread
From: Tommy S. Christensen @ 2002-05-16 12:30 UTC (permalink / raw)
  To: Venkata Rajesh Bikkina; +Cc: linux-mips

Venkata Rajesh Bikkina wrote:
> 
> Hi Tommy,
> 
> I am using 2.4.3 code and in that linux/mm/vmallo.c contains the following
> code which is slightly different from the patch you gave.
> 
>         } while (address && (address < end));
>         unlock_kernel();
>         flush_tlb_all();
>         return ret;
> 
> Can you please suggest how to modify this.
> 
> Regards,
> --Rajesh
> 

2.4.3 is quite old, so upgrading the kernel would clearly be a good idea.

Anyway, if you want to try this fix then you should remove the call to
flush_cache_all() at the top of vmalloc_area_pages() and change the line
flush_tlb_all() to flush_cache_all().

 -Tommy

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-05-16 12:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-15  8:42 RAMDISK problem on 79s334A board Venkata Rajesh Bikkina
2002-05-15 11:00 ` Alan Cox
2002-05-15 11:00   ` Alan Cox
2002-05-15 12:00   ` Venkata Rajesh Bikkina
2002-05-15 13:28     ` Alan Cox
2002-05-15 13:28       ` Alan Cox
2002-05-16  8:52       ` Tommy S. Christensen
2002-05-16 10:22         ` Venkata Rajesh Bikkina
2002-05-16 12:30           ` Tommy S. Christensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox