Re: Linux module for causing a system hard lock-up

2011-06-08 Thread Daniel Baluta
Hello, > Could anyone please let me know how can I achieve this? Is hard lockup detector enabled in your system? Could you post your .config. thanks, Daniel. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org

show_regs vs dump_stack in watchdog_timer_fn

2011-06-02 Thread Daniel Baluta
Hello, Why the stack isn't always dumped in watchdog_timer_fn ([1])? Registers content is useful, but without a stack trace it's very hard to find the task which caused system softlockup. thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.39/kernel/watchdog.c#L292

Re: OS Books suggestion

2011-06-01 Thread Daniel Baluta
Hello, > * The design of unix operating system (Bach) > > * Modern operative systems (Tanenbaum) > > * Operating Systems design and implementation(Tanenbaum) > > I haven't done formal Computer Science studies, and I don't the time to read > the three of them, but as I am working very close to the

Re: Can we map a device address to two different memory locations?

2011-05-27 Thread Daniel Baluta
On Fri, May 27, 2011 at 1:49 PM, sandeep kumar wrote: > Hi all, > Memory mapping is done so that CPU can access the devices, which it cant > unless. > > Now the question is can we memory map a one device resource(say some > iomemory) to two different memory locations? > the other way of seeing at

Re: Questions about preemption and concurrency

2011-05-27 Thread Daniel Baluta
On Fri, May 27, 2011 at 2:44 PM, Naman shekhar Mishra wrote: > In Operating System Concepts 6th ed, chapter 20: > "Kernel code can thus assume that it will never be preempted by another > process and that no special care must be > taken to protect critical sections. The only requirement is that cr

Re: how to download a specific kernel version from kernel.org

2011-05-23 Thread Daniel Baluta
Try this: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.tar.gz thanks, Daniel. On Mon, May 23, 2011 at 2:08 PM, sandeep kumar wrote: > Hi all, > I want to download kernel version 2.6.35 for a specific reason. > I have a patch which is to be applied to that specific kernel revision. >

Re: Linux kernel test suites

2011-05-21 Thread Daniel Baluta
On Sat, May 21, 2011 at 2:33 AM, Abu Rasheda wrote: > Can someone pass me pointer to Linux kernel test suite ? I am > specially interested in iptables (netfilter) and socket APIs. Hello Abu, Linux Test Project can be a good starting point ([1]). thanks, Daniel. [1] http://ltp.sourceforge.net/

Re: unlocked_ioctl explanation

2011-05-19 Thread Daniel Baluta
2011/5/19 Ezequiel García > > Thanks Dave for your answer. I guess the same question has been answered > several times before. For the interest reader, I've found these: > > http://unix.stackexchange.com/questions/4711/what-is-the-difference-between-ioctl-unlocked-ioctl-and-compat-ioctl > > http:

Re: tools to identify bugs in driver

2011-05-12 Thread Daniel Baluta
On Thu, May 12, 2011 at 7:34 AM, Amit Nagal wrote: > Hi , > > What are the mandatory tools that must be run to identify potential > bugs ( say memory , locking etc ) > in a linux device driver ? Turning on DEBUG_SLAB might be a good option. Have a look for all available options under make menucon

Re: char driver error

2011-05-09 Thread Daniel Baluta
OK. See how write and read works. > $strace echo -n "abcd" > /dev/memory(/home/aravind/me > write(1, "abcd", 4)                     = 1 > write(1, "bcd", 3)                      = 1 > write(1, "cd", 2)                       = 1 > write(1, "d", 1)                        = 1 >$ strace cat /dev/memo

Re: char driver error

2011-05-09 Thread Daniel Baluta
> i create a character special file using mknod in /dev directory. > > i try to write data to my file by" echo -n "abcd" > /dev/memory " > > and when i try to read from that file i get  the last char was written > to that file that is "d" Hello Aravind, Can you post the output for: $ strace -n "a

Re: registering a character driver without cdev_init()/cdev_add()

2011-05-04 Thread Daniel Baluta
>  so rather than the canonical combination of cdev_init() and > cdev_add(), this appears to register the pre-defined DSP56K major > number, then goes straight to registering the driver with sysfs. > Check register_chrdev code. [1] As you can see register_chrdev does cdev_alloc + cdev_add. >  is

Re: perhaps confused about operation of alloc_chrdev_region()

2011-04-21 Thread Daniel Baluta
Hi Robert, > static int __init bsr_init(void) > { >        struct device_node *np; >        dev_t bsr_dev = MKDEV(bsr_major, 0);   <--- You are right, this seems to be completely useless. Go on make a patch, compile and send it. thanks, Daniel.

Re: Interpreting call trace

2011-04-07 Thread Daniel Baluta
> For better understanding you can do >> gdb vmlinux > and then run > gdb> disassemble _read_unlock_bh > > Then look at offset 0x10. Did that. Is there any way to show disassembled output interleaved with source code? thank you all for your answers. Daniel.

Interpreting call trace

2011-04-06 Thread Daniel Baluta
Hello, I have the following stack trace: [3992.172/0] BUG: soft lockup - CPU#0 stuck for 61s! [events/0:39] [ 3992.215/0] Pid: 39, comm: events/0 Tainted: PW 2.6.32 #1 X8DTT-H [ 3992.222/0] RIP: 0010:[] [] __write_lock_failed+0x9/0x20 [ 3992.231/0] RSP: 0018:880028203908 EFLAGS: 00

Re: Scheduling policy

2011-04-04 Thread Daniel Baluta
On Mon, Apr 4, 2011 at 4:13 PM, Laurențiu Dascălu wrote: > Hello, > > I'm trying to implement a simple scheduling policy in the Linux kernel, > but I'm not sure if I correctly understand the sched_class interface. > Specifically, I would like to know more about the following functions: There's so

Re: query regarding kernel daemon

2011-04-04 Thread Daniel Baluta
> A daemon sleeps in the background. User can enter a string through the proc > interface. Whenever a string is entered, the daemon is woke. The daemon > keeps a copy of the last entered string in a variable. Initially the > variable is initialized to NULL. When the daemon wakes, it checks if the >

Re: why only C?

2011-04-03 Thread Daniel Baluta
On Sun, Apr 3, 2011 at 10:17 PM, mohit verma wrote: > Hi list, > I have a very basic question. How much time have you tried documenting on this topic [1]? thanks, Daniel. [1] http://answers.google.com/answers/threadview/id/718661.html ___ Kernelnewbi

Re: how to get kernel functions calling stack/invokation ordert

2011-04-01 Thread Daniel Baluta
> Is there a way to find, in the kernel src tree, which routine/function is > calling another function OR kernel function invocation stack order? > This would be helpful for me to know the various steps/functionalities > involved during executing something in kernel space. At runtime you can use d

Re: how to get kernel functions calling stack/invokation ordert

2011-04-01 Thread Daniel Baluta
> Is there a way to find, in the kernel src tree, which routine/function is > calling another function OR kernel function invocation stack order? > This would be helpful for me to know the various steps/functionalities > involved during executing something in kernel space. At runtime you can use d

Re: Snooping on sockets/file descriptors

2011-03-31 Thread Daniel Baluta
On Thu, Mar 31, 2011 at 10:29 PM, Vimal wrote: > Hi, > > Is it possible for an application (say "snoop", with sufficient > privileges) to monitor data on any socket/file descriptor in the > system? > > Here's an example:  suppose we have a browser and it creates a tcp > socket to connect to a URL.

Re: inconsistent lock state on call to kmem_cache_zalloc()

2011-03-17 Thread Daniel Baluta
On Thu, Mar 17, 2011 at 10:59 PM, Arvid Brodin wrote: > Hi, > > Daniel Baluta wrote: >> Hello, >> >>> The call to kmem_cache_zalloc() never returns; the printk() text on the line >>> after is never displayed and the system locks up. The printk() om the lin

Re: inconsistent lock state on call to kmem_cache_zalloc()

2011-03-17 Thread Daniel Baluta
Hello, > The call to kmem_cache_zalloc() never returns; the printk() text on the line > after is never displayed and the system locks up. The printk() om the line > before displays. What flags are you passing to kmem_cache_zalloc? thanks, Daniel. ___

Re: Gsoc participation

2011-03-14 Thread Daniel Baluta
Hello, > Unfortunately, I don't have particular project ideas. But I'm interested > in memory management and device drivers. What about making kmemleak [1] available on not yet supported architectures? thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.37.3/Documentation/kmemleak.txt _

Re: what is the kernel symbol for user space grant access driver

2011-03-02 Thread Daniel Baluta
Hello, > I want to know with respect to an image here > http://bderzhavets.files.wordpress.com/2010/04/pv-2-6-32-12.png > I have already compiled a kernel > it mentions to enable  "user space grant access driver" > While compiling I did not notice it how can I now verify post compile > some symbol

Re: messages printed lots of times

2011-02-26 Thread Daniel Baluta
> i am putting a printk() on link_path_walk() kernel function ( the pathname > resolution function). i access that printk() only at some special condition > (like if pathname passed to link_path_walk() matches with some name) . but > when it gets hit  like when i pass pathname via unlink(2) , lots

Re: syscalls performance

2011-02-25 Thread Daniel Baluta
On Sat, Feb 26, 2011 at 12:03 AM, Mauro Romano Trajber wrote: > Same behavior for a new syscall created from scratch. Instruction caching? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/ke

Re: syscalls performance

2011-02-25 Thread Daniel Baluta
On Fri, Feb 25, 2011 at 8:22 PM, Mauro Romano Trajber wrote: > Thanks Enrico and Daniel, you're right. glibc was caching getpid(); but this > is not the root cause of this behavior. > Going further, I decide to use call getpid without glibc, using >  syscall(SYS_getpid) to test this behavior and i

Re: syscalls performance

2011-02-25 Thread Daniel Baluta
Hi Mauro, On Fri, Feb 25, 2011 at 7:03 PM, Mauro Romano Trajber wrote: > I was doing some performance tests of system calls and I find an interesting > behavior. > Using RDTSC to count the CPU cycles, a single call to the getpid() consumes > about 7k of CPU clock cycles and ten calls consume appr

Re: Doubt regarding Minor Numbers and alloc_chrdev_region

2011-02-08 Thread Daniel Baluta
On Tue, Feb 8, 2011 at 5:50 PM, Sankar P wrote: > On Tue, Feb 8, 2011 at 5:36 PM, Daniel Baluta > wrote: >> >> > If I try to create a file using, 'mknod /dev/scull2 c 250 7' , the >> > character device file gets created with a minor number of 7. >&g

Re: Doubt regarding Minor Numbers and alloc_chrdev_region

2011-02-08 Thread Daniel Baluta
> If I try to create a file using, 'mknod /dev/scull2 c 250 7' , the > character device file gets created with a minor number of 7. You can create as much /dev/scull2 files using mknod as you want, but they are not linked with your driver. [first_minor, count] pair passed to alloc_chrdev_region r

Cloning 'struct file'

2011-01-26 Thread Daniel Baluta
Hi all, We know that each file descriptor fd, has an associated 'struct file'. How is the 'struct file' copied/cloned at fork? Are all fields of 'struct file' inherited by child? I want to know if there is a function which takes a struct file* and creates a consistent copy/clone of it. thanks, D

Re: Memory leak with dev_add_pack()

2011-01-23 Thread Daniel Baluta
Hi Spiro, > While it essentially works as I want it to, I found that I am leaking > memory this way. Having this module in a highly loaded network, > "head -n5 /proc/meminfo" shows that MemFree is steadily falling, until > the kernel OOPS with an out of memory condition. Have you considered using

Re: Running kmemleak without sysfs support

2011-01-21 Thread Daniel Baluta
On Thu, Jan 20, 2011 at 5:56 PM, Greg KH wrote: > On Thu, Jan 20, 2011 at 12:41:57PM +0200, Daniel Baluta wrote: >> Hello all, >> >> Can I make any use of kmemcheck if I don't have sysfs >> kernel support enabled? > > Why would you ever want to run a kernel

Re: Running kmemleak without sysfs support

2011-01-20 Thread Daniel Baluta
On Thu, Jan 20, 2011 at 12:52 PM, Catalin Marinas wrote: > On Thu, 2011-01-20 at 10:41 +0000, Daniel Baluta wrote: >> Can I make any use of kmemcheck if I don't have sysfs >> kernel support enabled? > > Kmemleak can scan output the memory and report the number of leaked

Re: Running kmemleak without sysfs support

2011-01-20 Thread Daniel Baluta
> Can I make any use of kmemcheck if I don't have sysfs > kernel support enabled? s/kmemcheck/kmemleak :D ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Running kmemleak without sysfs support

2011-01-20 Thread Daniel Baluta
Hello all, Can I make any use of kmemcheck if I don't have sysfs kernel support enabled? thanks, Daniel. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Casting sock to inet_timewait_sock

2011-01-14 Thread Daniel Baluta
Hello, When casting sock to inet_timewait_sock ([1]) it is assumed that sock points to a structure of type inet_timewait_sock. Is there a way to check if a sock struct wraps around a inet_timewait_sock struct? thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.37/include/net/inet_timewait_sock.

Casting sock to inet_timewait_sock

2011-01-14 Thread Daniel Baluta
Hello, When casting sock to inet_timewait_sock ([1]) it is assumed that sock points to a structure of type inet_timewait_sock. Is there a way to check if a sock struct wraps around a inet_timewait_sock struct? thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.37/include/net/inet_timewait_sock.

Re: How to design protocol stack with can-bus driver of character driver

2011-01-13 Thread Daniel Baluta
Hi, On Thu, Jan 13, 2011 at 6:42 PM, cheng chen wrote: > Hi all, > I am working on vehicle body control system with can-bus as my BE final > project. > It contains three parts. > 1.CAN chip driver > 2.CAN-bus protocol stack > 3.UI > The problem is that I already have written the CAN chip driver a

Re: FPGA registers userspace interface?

2011-01-03 Thread Daniel Baluta
> I thought about using 3 files in sysfs. > 1. address of the register > 2. data to write to the register > 3. trigger that do the write The most effective solution would be to have one file per register. Writing register: # echo value > /sys/path/to/file Reading register: # cat /sys/path/to/fil

Re: FPGA registers userspace interface?

2011-01-03 Thread Daniel Baluta
On Mon, Jan 3, 2011 at 2:47 PM, Kfir Lavi wrote: > Hi, > I have a FPGA that is constantly changing (its on development phase). > I want to let userspace app to update those registers, but don't want to > create an API yet. > What is the best way to open a range of registers to userspace, so no dri

Re: Is the new list working already?

2010-12-20 Thread Daniel Baluta
What will happen with the list archives? Daniel. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

<    1   2