Re SD/MMC subsystem resources

2011-11-10 Thread Asutosh Das
Hi All Please can you let me know if there are any good articles and/or books that explain the linux sd/mmc stack that you may know of. TIA -- ~/asd ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/l

Re: Re SD/MMC subsystem resources

2011-11-10 Thread loody
hi: 2011/11/10, Asutosh Das : > Hi All > Please can you let me know if there are any good articles and/or books > that explain the linux sd/mmc stack that you may know of. > > TIA > how about posting this message on the linux-mmc mailing list? ___ Kernel

Re: Spinlocks and interrupts

2011-11-10 Thread santhosh kumars
hi, Yes if config CONFIG_PREEMPT enabled,even if you dont have an smp box,we can think of preemption as equivalent to SMP.correct me if i am wrong about below lockings if we require locking only in user context: semaphore is preferred locking between user context(can be kernelpath) and sofirqs:spin

sd_prep_fn

2011-11-10 Thread sumeet gandhare
Hi All, I am trying to understand the scsi upper layer and middle layer code and found the function sd_prep_fn which seems to convert a request to a scsi command. I want to know when this function sd_prep_fn gets invoked. It seems sd_probe_async invokes blk_queue_prep_rq

Re: sd_prep_fn

2011-11-10 Thread rohan puri
On Thu, Nov 10, 2011 at 4:50 PM, sumeet gandhare wrote: > Hi All, > I am trying to understand the scsi upper layer and middle layer code and > found the function sd_prep_fn which seems to convert a request to a scsi > command. I want to know when this function sd_prep_fn gets invoked. > > It see

Re: sd_prep_fn

2011-11-10 Thread sumeet gandhare
On Thu, Nov 10, 2011 at 6:13 PM, rohan puri wrote: > > > On Thu, Nov 10, 2011 at 4:50 PM, sumeet gandhare > wrote: > >> Hi All, >> I am trying to understand the scsi upper layer and middle layer code >> and found the function sd_prep_fn which seems to convert a request to a >> scsi command. I

About kernel memory limit

2011-11-10 Thread Geraint Yang
Hi there, I am a newbie to Linux kernel programming. I am going to make a module which will cost much memory in kernel, I just want to know how much memory I can get by calling memory allocate API in kernel. Any help will be appreaciated. ___ Kernelnewbie

Re: sd_prep_fn

2011-11-10 Thread rohan puri
On Thu, Nov 10, 2011 at 6:26 PM, sumeet gandhare wrote: > > > On Thu, Nov 10, 2011 at 6:13 PM, rohan puri wrote: > >> >> >> On Thu, Nov 10, 2011 at 4:50 PM, sumeet gandhare < >> sumeetgandh...@gmail.com> wrote: >> >>> Hi All, >>> I am trying to understand the scsi upper layer and middle layer co

why tasklet cant sleep

2011-11-10 Thread santhosh kumars
hi, can any one please explain why tasklets cant sleep.softirqs and tasklets processing aided by the a set of per processor kernel threads(ksoftirqd) so it means tasklets/softirqs run in process context. it means tasklet can sleep right? thanks, karunakar. _

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
On 11/09/2011 08:38 PM, Dave Hylands wrote: > Hi Kai, > > On Wed, Nov 9, 2011 at 3:12 PM, Kai Meyer wrote: >> Ok, I need mutual exclusion on a data structure regardless of interrupts >> and core. It sounds like it can be done by using a spinlock and >> disabling interrupts, but you mention that

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
Well, I changed my code to use a mutex instead of a spinlock, and now I get: BUG: scheduling while atomic: swapper/0/0x1001 All I changed was the spinlock_t to a struct mutex, and call mutex_init, mutex_lock, and mutex_unlock where I was previously calling the spin_lock variations. I'm confus

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
I think I get it. I'm hitting the scheduling while atomic because I'm calling my function from a struct bio's endio function, which is probably running with a lock held somewhere else, and then my mutex sleeps, while the spin_lock functions do not sleep. Perhaps I need to learn more about the c

Re: Spinlocks and interrupts

2011-11-10 Thread Dave Hylands
Hi Kai, On Thu, Nov 10, 2011 at 10:14 AM, Kai Meyer wrote: > I think I get it. I'm hitting the scheduling while atomic because I'm > calling my function from a struct bio's endio function, which is > probably running with a lock held somewhere else, and then my mutex > sleeps, while the spin_lock

RE: Spinlocks and interrupts

2011-11-10 Thread Jeff Haran
> -Original Message- > From: kernelnewbies-bounces+jharan=bytemobile@kernelnewbies.org > [mailto:kernelnewbies- > bounces+jharan=bytemobile@kernelnewbies.org] On Behalf Of Dave > Hylands > Sent: Thursday, November 10, 2011 11:07 AM > To: Kai Meyer > Cc: kernelnewbies@kernelnewbies.o

Re: About kernel memory limit

2011-11-10 Thread Dave Hylands
Hi, On Thu, Nov 10, 2011 at 6:23 AM, Geraint Yang wrote: > Hi there, > I am a newbie to Linux kernel programming. I am going to make a module > which will cost much memory in kernel, I just want to know how much > memory I can get by calling memory allocate API in kernel. All of it. >From kerne

Re: why tasklet cant sleep

2011-11-10 Thread Dave Hylands
Hi santhosh, On Thu, Nov 10, 2011 at 8:38 AM, santhosh kumars wrote: > hi, > can any one please explain why tasklets cant sleep.softirqs and > tasklets processing aided by the a set of per processor > kernel threads(ksoftirqd) so it means tasklets/softirqs run in process > context. it means taskl

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
Alright, to summarize, for my benefit mostly, I'm writing a block device driver, which has 2 entry points into my code that will reach this critical section. It's either the make request function for the block device, or the resulting bio->bi_end_io function. I do some waiting with msleep() (fo

RE: Spinlocks and interrupts

2011-11-10 Thread Jeff Haran
> -Original Message- > From: kernelnewbies-boun...@kernelnewbies.org [mailto:kernelnewbies- > boun...@kernelnewbies.org] On Behalf Of Kai Meyer > Sent: Thursday, November 10, 2011 1:55 PM > To: kernelnewbies@kernelnewbies.org > Subject: Re: Spinlocks and interrupts > > Alright, to summariz

Re: Spinlocks and interrupts

2011-11-10 Thread Kai Meyer
On 11/10/2011 04:00 PM, Jeff Haran wrote: >> -Original Message- >> From: kernelnewbies-boun...@kernelnewbies.org [mailto:kernelnewbies- >> boun...@kernelnewbies.org] On Behalf Of Kai Meyer >> Sent: Thursday, November 10, 2011 1:55 PM >> To: kernelnewbies@kernelnewbies.org >> Subject: Re:

Re: When Are Free Pages Zeroed?

2011-11-10 Thread Mulyadi Santosa
Hi patrick :) On Thu, Nov 10, 2011 at 14:43, Patrick Simmons wrote: > I'm looking into the Linux memory management subsystem and need to know > when freed pages are zeroed.  Specifically, are they zeroed just before > they are reallocated, immediately after they are freed, or sometime > in-betwee

Re: sd_prep_fn

2011-11-10 Thread sumeet gandhare
On Thu, Nov 10, 2011 at 9:23 PM, rohan puri wrote: > > > On Thu, Nov 10, 2011 at 6:26 PM, sumeet gandhare > wrote: > >> >> >> On Thu, Nov 10, 2011 at 6:13 PM, rohan puri wrote: >> >>> >>> >>> On Thu, Nov 10, 2011 at 4:50 PM, sumeet gandhare < >>> sumeetgandh...@gmail.com> wrote: >>> Hi All,

Re: Re SD/MMC subsystem resources

2011-11-10 Thread mani
Hi, I also didnt get any good doc on the mmc sub system whereas there are few things that might help A slide which explains driver stack:- http://www.slideshare.net/champ_yen/linux-sdmmc-driver-stack Check JEDEC specs (open standard for MMC /eMMC) http://www.jedec.org/sites/default/files/docs/JES

Re: Re SD/MMC subsystem resources

2011-11-10 Thread Asutosh Das
Hi Thanks for your reply. Shall go through it. ~/asd On 11 November 2011 09:55, mani wrote: > Hi, > > I also didnt get any good doc on the mmc sub system > whereas there are few things that might help > A slide which explains driver stack:- > http://www.slideshare.net/champ_yen/linux-sdmmc-drive

Re: About kernel memory limit

2011-11-10 Thread Geraint Yang
Hi Dave, Thank you for your help ! Does it mean that I could use all of the memory my computer has? But one of my classmates told me that kernel could only use 1G from a 4G memory.computer...Is there anything I have misunderstood ? On Fri, Nov 11, 2011 at 4:58 AM, Dave Hylands wrote: > Hi, > >

Re: About kernel memory limit

2011-11-10 Thread Haojian Zhuang
On Fri, Nov 11, 2011 at 12:44 PM, Geraint Yang wrote: > Hi Dave, > Thank you for your help ! > Does it mean that I could use all of the memory my computer has? But one of > my classmates told me that kernel could only use 1G from a 4G > memory.computer...Is there anything I have misunderstood ? >

Re: About kernel memory limit

2011-11-10 Thread Dave Stevens
Quoting Geraint Yang : > Hi Dave, > Thank you for your help ! > Does it mean that I could use all of the memory my computer has? But one of > my classmates told me that kernel could only use 1G from a 4G > memory.computer...Is there anything I have misunderstood ? I'm sitting in front of a Ubuntu

Re: About kernel memory limit

2011-11-10 Thread Geraint Yang
Thanks. But I think that command 'free' just tell the memory used in kernel space and user space.It is still unknown to us that how much memory is used by kernel. On Fri, Nov 11, 2011 at 1:15 PM, Dave Stevens wrote: > Quoting Geraint Yang : > > Hi Dave, >> Thank you for your help ! >> Does it

RE: About kernel memory limit

2011-11-10 Thread adheer chandravanshi
Try this command: dmesg | grep Memory For me the output is: [0.00] Memory: 2007408k/2051636k available (4678k kernel code, 42932k reserved, 2124k data, 668k init, 1142332k highmem) Look here for more details: https://bbs.archlinux.org/viewtopic.php?id=14412 ~ Adheer From: geraint0..

Re: Spinlocks and interrupts

2011-11-10 Thread Rajat Sharma
For most of the block drivers bio_endio runs in a context of its tasklet, so it is indeed atomic context. -Rajat On Fri, Nov 11, 2011 at 4:50 AM, Kai Meyer wrote: > > > On 11/10/2011 04:00 PM, Jeff Haran wrote: >>> -Original Message- >>> From: kernelnewbies-boun...@kernelnewbies.org [mai