Subject: vmalloc on 2.4.x on ia64

Greetings.

Is vmalloc() interface broken on any of 2.4.x kernel on ia64 ?
I am trying to call vmalloc from the driver to allocate
about 130kb of memory and it hangs the system.
I am running 2.4.1 kernel with ia64 patch (I can find out the
exact patch if needed) on LION. Let me know if more information
is required.

Thanks and regards,
-hiren


Subject: RE: vmalloc on 2.4.x on ia64

That is what I said. I am using vmalloc only. But the call to
vmalloc is hanging.

-hiren

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Monday, April 02, 2001 6:26 PM
> To: [email protected]
> Subject: RE: vmalloc on 2.4.x on ia64
>
>
> kmalloc() has a limit of 128KB. Use get_free_pages() or
> vmalloc() instead,
> or break up your allocation into smaller hunks.
>
> Thanks,
> Matt
>
> --
> Matt Domsch
> Sr. Software Engineer
> Dell Linux Systems Group
> Linux OS Development
> http://www.dell.com/linux
>
>
>
> > -----Original Message-----
> > From: MEHTA,HIREN (A-SanJose,ex1) [mailto:[email protected]]
> > Sent: Monday, April 02, 2001 7:07 PM
> > To: '[email protected]'
> > Subject: vmalloc on 2.4.x on ia64
> >
> >
> > Greetings.
> >
> > Is vmalloc() interface broken on any of 2.4.x kernel on ia64 ?
> > I am trying to call vmalloc from the driver to allocate
> > about 130kb of memory and it hangs the system.
> > I am running 2.4.1 kernel with ia64 patch (I can find out the
> > exact patch if needed) on LION. Let me know if more information
> > is required.
> >
> > Thanks and regards,
> > -hiren
> > -
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-kernel" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
> >
>

Subject: RE: vmalloc on 2.4.x on ia64

Can we call vmalloc() or get_free_pages() from scsi low-level driver
(HBA driver) ? The reason why I am asking is because, I am calling
vmalloc from scsi low-level driver and I tried this on 2.4.2 on
ia32 as well as ia64 and on both the systems, it is hanging.
on ia64 it happens everytime whereas on ia32 it happens intermittently.
In case of ia32, I had watchdog enabled. So, on ia32, it detects LOCKUP
and generates call trace. I am yet to try get_free_pages().

TIA,
-hiren

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Monday, April 02, 2001 6:30 PM
> To: [email protected]
> Subject: RE: vmalloc on 2.4.x on ia64
>
>
> > That is what I said. I am using vmalloc only. But the call to
> > vmalloc is hanging.
>
> Oops, my mistake. a) that shouldn't happen. b) if it does, try
> get_free_pages().
>

2001-04-05 00:01:58

by Alan

[permalink] [raw]
Subject: Re: vmalloc on 2.4.x on ia64

> Can we call vmalloc() or get_free_pages() from scsi low-level driver
> (HBA driver) ? The reason why I am asking is because, I am calling

It depends where. You can call it during initialisation if you arent holding
the io_request_lock for example.

Subject: RE: vmalloc on 2.4.x on ia64

I am calling during initialization only from detect() entry point.
But I guess, before the detect() is called, scsi layer acquires
the io_request_lock. So, you mean to say that I need to release it
before calling vmalloc() ? I was doing the same thing on 2.2.x
and even on 2.4.0 and it was working fine and now suddenly
it stopped working on 2.4.2. So what are the guidelines for using
vmalloc() if we want to use it in scsi low-level (HBA) driver ?
I am currently using the new error handling code. (use_new_eh_code = TRUE).

Regards,
-hiren

> -----Original Message-----
> From: Alan Cox [mailto:[email protected]]
> Sent: Wednesday, April 04, 2001 5:03 PM
> To: [email protected]
> Cc: [email protected]; [email protected]
> Subject: Re: vmalloc on 2.4.x on ia64
>
>
> > Can we call vmalloc() or get_free_pages() from scsi
> low-level driver
> > (HBA driver) ? The reason why I am asking is because, I am calling
>
> It depends where. You can call it during initialisation if
> you arent holding
> the io_request_lock for example.
>

2001-04-05 00:17:38

by Andi Kleen

[permalink] [raw]
Subject: Re: vmalloc on 2.4.x on ia64

On Wed, Apr 04, 2001 at 06:11:32PM -0600, [email protected] wrote:
> I am calling during initialization only from detect() entry point.
> But I guess, before the detect() is called, scsi layer acquires
> the io_request_lock. So, you mean to say that I need to release it
> before calling vmalloc() ? I was doing the same thing on 2.2.x
> and even on 2.4.0 and it was working fine and now suddenly
> it stopped working on 2.4.2. So what are the guidelines for using
> vmalloc() if we want to use it in scsi low-level (HBA) driver ?
> I am currently using the new error handling code. (use_new_eh_code = TRUE).

It probably never worked correctly in all cases.

If you don't rely on the synchronization given by the io_request_lock you can
drop it around the vmalloc() call.


-Andi

2001-04-05 00:27:46

by Alan

[permalink] [raw]
Subject: Re: vmalloc on 2.4.x on ia64

> I am calling during initialization only from detect() entry point.
> But I guess, before the detect() is called, scsi layer acquires
> the io_request_lock. So, you mean to say that I need to release it

That depends if your driver is doing old or new style initialization

> before calling vmalloc() ? I was doing the same thing on 2.2.x
> and even on 2.4.0 and it was working fine and now suddenly
> it stopped working on 2.4.2. So what are the guidelines for using
> vmalloc() if we want to use it in scsi low-level (HBA) driver ?

You can use vmalloc in any situation where you are in task context
and can sleep.

> I am currently using the new error handling code. (use_new_eh_code = TRUE).

Then yes you would need to drop the lock if my memory serves me rightly.

Subject: RE: vmalloc on 2.4.x on ia64

dropping the io_request_lock around vmalloc worked great.
Thanks for all the help. I really appreciate it.

Thanks
-hiren

> -----Original Message-----
> From: Alan Cox [mailto:[email protected]]
> Sent: Wednesday, April 04, 2001 5:29 PM
> To: [email protected]
> Cc: [email protected]; [email protected];
> [email protected]
> Subject: Re: vmalloc on 2.4.x on ia64
>
>
> > I am calling during initialization only from detect() entry point.
> > But I guess, before the detect() is called, scsi layer acquires
> > the io_request_lock. So, you mean to say that I need to release it
>
> That depends if your driver is doing old or new style initialization
>
> > before calling vmalloc() ? I was doing the same thing on 2.2.x
> > and even on 2.4.0 and it was working fine and now suddenly
> > it stopped working on 2.4.2. So what are the guidelines for using
> > vmalloc() if we want to use it in scsi low-level (HBA) driver ?
>
> You can use vmalloc in any situation where you are in task context
> and can sleep.
>
> > I am currently using the new error handling code.
> (use_new_eh_code = TRUE).
>
> Then yes you would need to drop the lock if my memory serves
> me rightly.
>