Re: How to wake_up the wait_queue of a socket?

2013-01-15 Thread Valdis . Kletnieks
On Mon, 14 Jan 2013 17:50:03 +0800, horseriver said: When one datagram has reached , How to wake_up the wait_queue of that socket ? Please clarify your question - I'm not sure which of the following you mean: 1) How does the kernel wake up the waiting process when a datagram arrives? 2)

Re: Best way to configure Linux kernel for a machine

2013-01-17 Thread Valdis . Kletnieks
On Wed, 16 Jan 2013 17:47:08 +0530, Shraddha Kamat said: I normally do the kernel configuration on my machine like this - * copy the distro configuration file to the kernel dir * make menuconfig (answer Y's/N's/M's) Normally keep return key pressed for default answers * then do the actual

Re: no error thrown with exit(0) in the child process of vfork()

2013-01-18 Thread Valdis . Kletnieks
On Fri, 18 Jan 2013 19:59:38 +0530, Niroj Pokhrel said: I have been trying to create a process using vfork(). And both of the child and the parent process execute it in the same address space. So, if I execute exit(0) in the child process, it should throw some error right. Why do you think it

Re: bitops or mutex

2013-01-21 Thread Valdis . Kletnieks
On Mon, 21 Jan 2013 19:16:47 +0530, Prashant Shah said: There is a bitmap that needs to be locked across many threads for test / set bit operations. Which one is faster - bitops or mutex ? 1. Bitops : set_bit(5, (long unsigned *)tmp); 2. Mutex : mutex_lock(m); *tmp = (*tmp) | (1 5);

Re: Can jiffies freeze?

2013-01-22 Thread Valdis . Kletnieks
On Tue, 22 Jan 2013 10:29:05 -0800, sandeep kumar said: I am seeing this problem at the very early in the start_kernel-- mm_init-- free_highpages, at that time nothing is up and kernel is running in single thread. If you build a kernel with printk timestamps, you'll see that they all come out

Re: Can jiffies freeze?

2013-01-22 Thread Valdis . Kletnieks
On Tue, 22 Jan 2013 11:32:19 -0800, sandeep kumar said: as you rightly mentioned,cat /proc/kmsg is showing the time stamps, according to that it is 0ms only. But when you see the same with UART there is 2sec delay in showing the next log. i caught this while i m observing the UART logs with

Re: Can jiffies freeze?

2013-01-23 Thread Valdis . Kletnieks
On Wed, 23 Jan 2013 14:05:25 +0800, bill4carson said: Hmmm, all the boot messages are routed into a buffer it first printed into console, here there is no delay, possible tick timer are not setup yet. But when it does get printed into the console, this process could be interrupted by other

Re: Intercepting a system call

2013-01-25 Thread Valdis . Kletnieks
On Fri, 25 Jan 2013 18:58:29 +0530, Paul Davies C said: [1] is the module I wrote for intercepting the system call fork(). Totally skipping over the details of actually doing it - it's usually considered a Bad Idea to hook a system call, and 98% of the time there's a much better way to

Re: locking spinlocks during copy_to_user, copy_from_user

2013-01-25 Thread Valdis . Kletnieks
On Fri, 25 Jan 2013 09:58:42 -0300, Pablo Pessolani said: My question is: Is there any know consequence if I enable preemption before copy_to_user/copy_from user (keeping the spinlock locked) and then disable preemption again after the copy? Well, at that point, you potentially have a

Re: GRUB question

2013-01-28 Thread Valdis . Kletnieks
On Mon, 28 Jan 2013 06:10:36 +0800, horseriver said: On Mon, Jan 28, 2013 at 12:05:35PM +0530, Mandeep Sandhu wrote: On Mon, Jan 28, 2013 at 2:07 AM, horseriver horseriv...@gmail.com wrote: hi:) Is /boot/initrd.img a root filesystem? what is the filetype of it? Yes, it's a rootfs

Re: thread concurrent file operation

2013-01-29 Thread Valdis . Kletnieks
On Tue, 29 Jan 2013 16:56:02 +0100, Tobias Boege said: Look some lines above: struct fd f = fdget(fd); That creates a reference, not a lock. It basically assures that the system doesn't reap and reclaim that fd out from under the code. (In other words, it's managing lifetime, not

Re: thread concurrent file operation

2013-01-29 Thread Valdis . Kletnieks
On Tue, 29 Jan 2013 18:25:19 +0100, Karaoui mohamed lamine said: This function is supposed to return the file reference, does do the locking? Refcounting only, no locking provided by fdget. It seems that i can't find the lock instruction( with all those rcu instructions, i am little lost),

Re: Kernel Config for Chromium Browser?

2013-01-31 Thread Valdis . Kletnieks
On Thu, 31 Jan 2013 16:15:45 +0100, Martin Kepplinger said: I stripped down my .config for my kernel-compilation a bit, but thought that I really just removed unnecessary stuff. But really, the consequency was, that the Chromium Browser didn't load _any_ page. Not even locally and no chrome://

Re: Android Kernel Compilation

2013-01-31 Thread Valdis . Kletnieks
On Thu, 31 Jan 2013 18:24:01 +0100, Matthias Brugger said: 2013/1/30 Rahul Gandhi rahul.rahulg...@gmail.com: I am trying to compile Kernel for my Android device. I am using the NDK Toolchain (arm-linux-androideabi-4.4.3). When I use the defconfig, the kernel compiles without any errors but

Re: kernel driver vs userspace program

2013-01-31 Thread Valdis . Kletnieks
On Thu, 31 Jan 2013 13:38:07 -0500, Simon said: Hi guys, I'm building an electrical device which will be controlled by computer. It will have an embedded microcontroller and will use USB to communicate with the PC. I believe this calls automatically for a device driver, correct? And for

Re: open image file

2013-02-05 Thread Valdis . Kletnieks
On Tue, 05 Feb 2013 04:59:42 +0800, horseriver said: hi: It is not a cpio archive , so that command can not work . its file system type is tmpfs. Umm. No. It's not tmpfs. tmpfs is a specific ram/swap based filesystem - basically, take enough 4K pages for the size= parameter and do it in

Re: Process exit codes

2013-02-05 Thread Valdis . Kletnieks
On Tue, 05 Feb 2013 14:07:37 +0100, Grzegorz Dwornicki said: I guess that there may be a better API that why this thread was created in first place. My project goal is to make process checkpoints like cryopid had. This is for my thesis and will be GPL for everyone after my graduaction. I am

Re: pr_info not printing message in /var/log/messages

2013-02-05 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 04:43:20 +0800, Jimmy Pan said: in fact, i've been always wondering what is the relationship between dmesg and /var/log/message. they diverse a lot... What ends up in /var/log/message is some subset (possibly 100%, possibly 0%) of what's in dmesg. Where your syslog daemon

Re: When does the /dev/sda1 node comes into being ?

2013-02-05 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 01:26:44 +0800, horseriver said: During booting period .every device will have a node at /dev/ folder. what is the detail of ths procedure? 'man udev'. Although the details are a tad murkier for kernels after 2.6.32 that include CONFIG_DEVTMPFS in the config. Also,

Re: hard disk dirver

2013-02-05 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 02:53:11 +0800, horseriver said: At booting time ,bootloader loads kernel from hard disk too memory. During this period,does it need hd driver's support . Think for a bit - at that point, the hd driver hasn't been loaded yet, so it *can't* need the hd driver's support.

Re: hard disk dirver

2013-02-05 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 05:37:41 +0800, horseriver said: After grub load kernel and initrd , it get around root filesystem mounting , but failed with no finding root device ,from which kernel and initrd have been located . ls /dev/ ; there is no disk device node . Why? Any number

Re: hard disk dirver

2013-02-06 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 12:30:37 +0800, horseriver said: root = ? You mean the aasignment at grub command line ? For instance, the grub entry for the kernel I'm running right now: title 3.8.0-rc6-next-20130206 kernel /vmlinuz-3.8.0-rc6-next-20130206 ro

Re: hard disk dirver

2013-02-06 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 13:21:17 +0800, horseriver said: At booting stage,kernel need to detect the hard device before mount it, does this work need pci's surport? That depends. Is the controller for the hard drive a PCI-based controller? On most x86-based boxes, it is (and I'm not sure

Re: Creating scheduler

2013-02-06 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 23:19:26 +0530, jeshkumar...@gmail.com said: Can anyone suggest a good tutorial to create our own scheduler ? Doing an I/O scheduler is pretty trivial, and there's a number of examples in-tree already to look at. If you mean a CPU scheduler, the major reason why there's no

Re: hard disk dirver

2013-02-06 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 13:20:13 -0500, Greg Freemyer said: Most new MB's have a SATA controller directly on the MB connected directly to either the North or South bridge (I don't know which). I don't think any PCI is support needed to talk to the boot disk. Yes, but said SATA controller and

Re: Creating scheduler

2013-02-06 Thread Valdis . Kletnieks
On Wed, 06 Feb 2013 20:40:47 +0100, Jonathan Neuschäfer said: I'm sorry to ask, but don't you rather mean watts than watts per second? There may indeed be a second order time component involved - for instance, a cooling system that can handle 10 watts continuously, 20 watts for up to 30

Re: hd controller

2013-02-07 Thread Valdis . Kletnieks
On Thu, 07 Feb 2013 16:19:33 +0800, horseriver said: hi:) I am curious about how hd controller work . When user am reaing/writing hd ,it was implemented by sending command to hd controller's special port.Then ,how does the controller know a new command has received? In this

Re: pr_info not printing message in /var/log/messages

2013-02-07 Thread Valdis . Kletnieks
On Thu, 07 Feb 2013 23:20:27 +0530, anish kumar said: Other insteresting standard logs managed by syslog are /var/log/auth.log, /var/log/mail.log. Other interesting *common* logs, as shipped pre-configured by some distros. They are hardly a standard (unless the definitions of these managed to

Re: hd controller

2013-02-07 Thread Valdis . Kletnieks
On Fri, 08 Feb 2013 07:48:39 +0800, Peter Teoh said: So the drivers just literally concatenate these command into a string and send it over to the device. The reason that good disk drivers are hard to write is because it isn't *just* literally concatenating the commands - it also has to do

Re: MAX limit of file descriptor

2013-02-11 Thread Valdis . Kletnieks
On Sat, 09 Feb 2013 13:10:47 +0800, horseriver said: In one process ,what is the max number of opening file descriptor ? Can it be set to infinite ? In network programing ,what is the essential for the maximum of connections dealed per second In general, you'll find that

Re: MAX limit of file descriptor

2013-02-11 Thread Valdis . Kletnieks
On Mon, 11 Feb 2013 06:07:38 +0800, horseriver said: Actually , my question comes from network performance ,I want to know ,in per second ,the maximum of tcp connections that can be dealed with by my server. That will be *highly* dependent on what your server code does with each

Re: start address of the code segment of the program on x86-64

2013-02-14 Thread Valdis . Kletnieks
On Thu, 14 Feb 2013 15:33:48 +0200, Kevin Wilson said: Hi, 0x08048000 address is the start address of the code segment of a program in on x86-32. More likely, it was the start address of *one particular run* of the program. In most kernel configurations, there's something called Address

Re: using prefetch

2013-02-15 Thread Valdis . Kletnieks
On Fri, 15 Feb 2013 12:16:02 +0200, Kevin Wilson said: Is the prefetch operation synchronous ? I mean, after calling it, are we gauranteed that the variable is indeed in the cache ? No, the whole *point* is that it's asynchronous. You issue the prefetch several lines of code before you need

Re: process 0 (swapper)

2013-02-16 Thread Valdis . Kletnieks
On Sat, 16 Feb 2013 18:48:52 +0200, Kevin Wilson said: ~0U is not 0 but -1; -ENOCAFFEINE. You'd think that after having done kernel-level C programming since the days of SunOS 3.1.5 and BSD 4.2 I'd k know better. ;) pgpBxhyWvlc2R.pgp Description: PGP signature

Re: Tracing SIGKILL, is that possible?

2013-02-18 Thread Valdis . Kletnieks
On Mon, 18 Feb 2013 15:46:58 -0300, Daniel. said: Is there a way to track signals, specially SIGKILL. I would like to know if some process dies because reach some resource limit, because an OMM error or something likewise.. Depends on where you want the tracking to go. But your first thing to

Re: Linux Kernel

2013-02-18 Thread Valdis . Kletnieks
On Tue, 19 Feb 2013 10:50:26 +0530, kapil agrawal said: How the linux kernel runs in the system after spawning the init and mounting the root FS. Does it run as some background process ? No. You probably want to get some basic knowledge about operating systems in general.

Re: Linux Kernel

2013-02-18 Thread Valdis . Kletnieks
On Tue, 19 Feb 2013 12:01:55 +0530, kapil agrawal said: Do you mean process with PID 0 is the one, which runs in the background and serves the request from userland and goes to cpu_idle() if nothing to run. No. Large parts of the kernel run in kernel mode, but using the 'struct task' of the

Re: SIGKILL and a sleeping kernel module

2013-02-19 Thread Valdis . Kletnieks
On Tue, 19 Feb 2013 10:37:28 +0200, Kevin Wilson said: Hi all, I am trying to send a SIGKILL to a kernel module which is sleeping. I added a printk after the sleep command. Sending a SIGLKILL (by kill -9 SIGLKILL pidOfKernelThread) does **not** yield the message from printk(calling

Re: cpu_relax(), rep: nop, and PAUSE

2013-02-19 Thread Valdis . Kletnieks
On Wed, 20 Feb 2013 01:58:17 +0700, Mulyadi Santosa said: On Tue, Feb 19, 2013 at 7:20 PM, David Shwatrz dshwa...@gmail.com wrote: Hi, kernel newbies, We have: #define cpu_relax() asm volatile(rep; nop) in arch/x86/boot/boot.h. Why don't we use the PAUSE assembler instruction

Re: unsubscibe

2013-02-21 Thread Valdis . Kletnieks
On Thu, 21 Feb 2013 15:57:46 +0530, Sandeep Sonawane said: Please remove my email id sandeep.sonaw...@gmail.com from this DL. If your mail software supported RFC2369 mail headers, you would have seen the following on every posting to the list: List-id: Learn about the Linux kernel

Re: Sending an IP packet

2013-02-22 Thread Valdis . Kletnieks
On Fri, 22 Feb 2013 14:36:17 +0200, Adel Qodmani said: My question is quite simple, I have an sk_buff that I want to transmit, the sk_buff is an ICMP message and so far, I've built the headers and set up everything. Others have given some details on how. A better question is why. Sending an

Re: Sending an IP packet

2013-02-22 Thread Valdis . Kletnieks
On Fri, 22 Feb 2013 17:15:35 +0200, you said: I am trying to implement a new protocol that we've designed which works on top of the IP layer, so I am using ICMP messages to carry control information for the protocol. Why using ICMP, it seemed natural since our protocol is a Network-layer

Re: atomic operations

2013-02-24 Thread Valdis . Kletnieks
On Sun, 24 Feb 2013 11:50:14 +0100, richard -rw- weinberger said: On Sun, Feb 24, 2013 at 10:42 AM, Shraddha Kamat sh200...@gmail.com wrote: what is the relation between atomic operations and memory alignment ? I read from UTLK that an unaligned memory access is not atomic please

Re: barrier()

2013-02-24 Thread Valdis . Kletnieks
On Mon, 25 Feb 2013 12:26:06 +0530, Shraddha Kamat said: #define barrier() asm volatile( ::: memory) What exactly volatile( ::: memory) doing here ? You probably should read Documentation/memory-barriers.txt in your kernel source tree, and let us know if you still have questions after that...

Re: general_protection result to die

2013-02-26 Thread Valdis . Kletnieks
On Tue, 26 Feb 2013 06:23:34 +0800, horseriver said: does general_protection trap necessarily result to die ? Think for a bit - what other actions can reasonably be taken? You hit a GPF, it's obvious that the variables you're working on have been corrupted, so automatically continuing is

Re: How to measure the RAM read/write performance

2013-02-26 Thread Valdis . Kletnieks
On Tue, 26 Feb 2013 22:35:35 +0700, Mulyadi Santosa said: let' see what if you do read and write pattern, in certain order so that it will be invalidated by the L1/L2/L3 cache everytime? AFAIK, one thing for sure, reading data from sequentially and re-read them will make end up reading

Re: Kernel freeze when writing e1000 driver

2013-02-26 Thread Valdis . Kletnieks
On Tue, 26 Feb 2013 11:19:18 -0500, Phani Vadrevu said: I am writing a network driver for the e1000 card. While doing the receive part, I saw that the kernel freezes whenever it reaches the netif_rx(skb) call. I was able to reproduce the same error when using a bare bones driver where I hard

Re: How to measure the RAM read/write performance

2013-02-27 Thread Valdis . Kletnieks
On Wed, 27 Feb 2013 15:38:00 +0530, sandeep kumar said: In development phase of the board, we are trying to measure RAM performance gain while changing type of the RAM. The standard benchmark tools are giving us the Cache performance only. So we want to try some method to measure RAM

Re: [ARM_LINUX] ioremap() allowing to map system memory...

2013-03-01 Thread Valdis . Kletnieks
On Fri, 01 Mar 2013 16:48:12 +0530, sandeep kumar said: Don't you think it should throw panic()while calling the ioremap() itself. Because this sounds like a serious violation... As you noted, it does give you a warning. That's a kernel design philosophy - to reserve the panic() and BUG()

Re: [filesystem] struct of m_inode

2013-03-01 Thread Valdis . Kletnieks
On Sat, 02 Mar 2013 10:28:26 +0800, lx said: if (block = 7+512+512*512) because the i_zone[9]. But the question is why the i_zone[7] can repesent 512 , and i_zone[8] can repesent 512*512 ? Sngle, double, and triple indirect blocks... http://en.wikipedia.org/wiki/Inode_pointer_structure

Re: Why vmlinux.bin are changed from raw image to elf for x86 ?

2013-03-02 Thread Valdis . Kletnieks
On Sat, 02 Mar 2013 16:36:43 +0800, Jacky said: The -O binary is removed. And I don't find any changelog. A quick course on researching kernel development history... Step 1: 'git blame arch/x86/boot/compressed/Maekfile' That gives us the line: 099e1377 (Ian Campbell2008-02-13

Re: how to trace tcp protocol stack ?

2013-03-03 Thread Valdis . Kletnieks
On Sun, 03 Mar 2013 12:13:51 +0800, ishare said: Is there mothod to look up the call stack of tcp protocol solution? ftrace and related functionality. Note that there is a difference between look up the call stack and trace the flow of execution. Consider the following code: int a (

Re: Module compilation error

2013-03-04 Thread Valdis . Kletnieks
On Tue, 05 Mar 2013 09:07:51 +0700, Mulyadi Santosa said: On Tue, Mar 5, 2013 at 7:48 AM, Pietro Paolini pulsarpie...@aol.com wrote: echo 2 Run 'make oldconfig make prepare' on kernel src try the suggested above step. IIRC, those commands will do things like preparing the

Re: pthread_lock

2013-03-04 Thread Valdis . Kletnieks
On Tue, 05 Mar 2013 11:02:45 +0530, Mandeep Sandhu said: next schedule. I think the waiting threads (processes) will moved from the wait queue to the run queue from where they will be scheduled to run. For bonus points, read source code and/or comments and figure out what Linux does to

Re: Query on skb buffer

2013-03-06 Thread Valdis . Kletnieks
On Wed, 06 Mar 2013 10:39:13 -0800, Kumar amit mehta said: Now, if alloc_skb(4096, GFP_KERNEL) is the routine that gets called to allocate the kernel buffer then, how does the kernel manages such prospective memory allocation failures and how kernel manages large packet requests from the

Re: Several unrelated beginner questions.

2013-03-06 Thread Valdis . Kletnieks
On Wed, 06 Mar 2013 18:19:09 -0500, Konstantin Kowalski said: 1.) Currently, I am reading 2 books about Linux kernel: Linux Device Drivers (3rd edition) and Linux Kernel Development (3rd edition). I like both books and I am learning a lot from them. I heard that both of this books are

Re: zap_low_mappings

2013-03-06 Thread Valdis . Kletnieks
On Thu, 07 Mar 2013 10:33:18 +0800, ishare said: kernel halts because the page mapping has been modified by zap_low_mappings why we should do zap_low_mappings in init procedure ? this will disorder the page mapping. You might want to get yourself an up to date kernel, as the code

Re: zap_low_mappings

2013-03-06 Thread Valdis . Kletnieks
On Thu, 07 Mar 2013 11:43:43 +0800, ishare said: set_pgd(swapper_pg_dir+i, __pgd(0)); If I have not define CONFIG_X86_PAE ,then the low mem will be invalided all . And what makes you think that call invalidates *all* the page mappings? pgpwj47K1DPrA.pgp Description: PGP

Re: Disabling interrupts and masking interrupts

2013-03-07 Thread Valdis . Kletnieks
On Thu, 07 Mar 2013 17:17:19 +0200, Kevin Wilson said: Does this mean that once you are disabling interrupts, these interrupts are lost ? even later, when we will enable interrupts, the interrupts from the past that should have been created (but interrupts were disabled at that time

Re: Disabling interrupts and masking interrupts

2013-03-07 Thread Valdis . Kletnieks
On Thu, 07 Mar 2013 09:28:58 -0800, Dave Hylands said: In my experience, edges triggered interrupts are always latched by the HW when they arrive. If another edge comes along between the initial edge and the time that the interrupt is cleared, then this second edge is lost. The fact that an

Re: Userspace interception of locally valid memory location

2013-03-10 Thread Valdis . Kletnieks
On Sun, 10 Mar 2013 19:27:52 +0530, harish badrinath said: Is it possible to intercept (both read and write) a locally valid address of a process and replace it with our own values (it is for a transparent distributed shared memory project). Go look at how gdb traces variables.

Re: Userspace interception of locally valid memory location

2013-03-10 Thread Valdis . Kletnieks
On Sun, 10 Mar 2013 19:27:52 +0530, harish badrinath said: Hello, Is it possible to intercept (both read and write) a locally valid address of a process and replace it with our own values (it is for a transparent distributed shared memory project). (Damn, hit send too soon) Go look at how

Re: 64bit MMIO access

2013-03-10 Thread Valdis . Kletnieks
On Sun, 10 Mar 2013 20:35:37 +0100, Jagath Weerasinghe said: readq and writeq do the job. Please double-check how those are implemented on your architecture. I seem to remember that on some systems, readq and writeq may not be atomic and may become two bus cycles. And some hardware cares about

Re: 64bit MMIO access

2013-03-10 Thread Valdis . Kletnieks
On Sun, 10 Mar 2013 20:35:37 +0100, Jagath Weerasinghe said: Hi, readq and writeq do the job. (hit send too soon) Also, the read/write [bwlq] functions refer to the width of the *data*, not the address pgpRFJDCHascC.pgp Description: PGP signature

Re: User space memory

2013-03-12 Thread Valdis . Kletnieks
On Tue, 12 Mar 2013 18:38:05 +0530, Prabhu nath said: On Sun, Mar 10, 2013 at 11:30 PM, Christoph Seitz c.se...@tu-bs.de wrote: I use a char device for reading and writing from/to a pcie dma card. Especially the read function makes me some headache. The user allocates some memory with

Re: User space memory

2013-03-12 Thread Valdis . Kletnieks
On Tue, 12 Mar 2013 15:03:53 +0100, Christoph Seitz said: I found out, if I use the force flag with get_user_pages, the pages get faulted, but there has to be a nicer way than using the force flag. Why does there have to be a nicer way? Maybe you already got the nice way. (Hint - why does

Re: block mailing list?

2013-03-15 Thread Valdis . Kletnieks
On Fri, 15 Mar 2013 06:22:14 -0700, Raymond Jennings said: Is there a kernel list dedicated to discussion of block devices? What's to discuss? There probably isn't enough ongoing traffic to support a separate mailing list (we got too many of them as it is :) MAINTAINERS says: BLOCK LAYER M:

Re: signals handling: kill() successful, but nothing delivered

2013-03-18 Thread Valdis . Kletnieks
On Mon, 18 Mar 2013 06:50:25 +0100, mic...@michaelblizek.twilightparadox.com said: Hi! On 06:52 Fri 08 Mar , mic...@michaelblizek.twilightparadox.com wrote: ./a.out `ps a|grep wget|grep -v grep To save the double grep, you can do something like this: ps a | grep '[w]get' | ...

Re: programme header

2013-03-18 Thread Valdis . Kletnieks
On Tue, 19 Mar 2013 09:38:49 +0800, ishare said: I am linking my kernel by a link script. its contens is as below: I think it will work ,but ld report that No enough room for programme header,what is the reason? what should I do ? The first thing you do is ask yourself why you're using

Re: programme header

2013-03-18 Thread Valdis . Kletnieks
On Tue, 19 Mar 2013 12:44:36 +0800, ishare said: because I need to generate a .so for sysenter used And that solves what problem for you, exactly? Consider that most architectures that use sysenter manage to do so without having to worry about a .so for it (or if they really do need one,

Re: Memory allocations in linux for processes

2013-03-19 Thread Valdis . Kletnieks
On Tue, 19 Mar 2013 20:41:55 +0530, Niroj Pokhrel said: #includestdio.h int main() { while(1) { } return 0; } I don't understand where does mmap or malloc come in to play in this code. Unless you linked it statically, a lot of stuff happens before you ever get to main()

Re: kernel build error

2013-03-20 Thread Valdis . Kletnieks
On Wed, 20 Mar 2013 00:07:57 -0700, Kumar amit mehta said: I forgot that 'uname -m' will return me the kernel version and _not_ the CPU architecture. The CPU on my machine seem to be 64 bit (/proc/cpuinfo|grep flags shows 'lm'). So my understanding is that I've a 32 bit kernel running on a

Re: BFQ: simple elevator

2013-03-20 Thread Valdis . Kletnieks
On Thu, 21 Mar 2013 02:24:23 +0700, Mulyadi Santosa said: pardon me for any possible sillyness, but what happen if there are incoming I/O operation at very nearby sectors (or perhaps at the same sector?)? I suppose, the elevator will prioritize them first over the rest? (i.e starving will

Re: BFQ: simple elevator

2013-03-20 Thread Valdis . Kletnieks
On Wed, 20 Mar 2013 14:41:31 -0700, Raymond Jennings said: Suppose you have requests at sectors 1, 4, 5, and 6 You dispatch sectors 1, 4, and 5, leaving the head parked at 5 and the direction as ascending. But suddenly, just before you get a chance to dispatch for sector 6, sector 4 gets

Re: Linux elevators (Re: BFQ: simple elevator)

2013-03-20 Thread Valdis . Kletnieks
On Wed, 20 Mar 2013 16:05:09 -0700, Arlie Stephens said: The ongoing thread reminds me of a simple question I've had since I first read about linux' mutiple I/O schedulers. Why is the choice of I/O scheduler global to the whole kernel, rather than per-device or similar? They aren't global to

Re: BFQ: simple elevator

2013-03-21 Thread Valdis . Kletnieks
On Wed, 20 Mar 2013 16:37:41 -0700, Raymond Jennings said: Hmm...Maybe a hybrid approach that allows a finite number of reverse seeks, or as I suspect deadline does a finite delay before abandoning the close stuff to march to the boonies. Maybe. Maybe not. It's going to depend on the

Re: optimization in kernel compile

2013-03-22 Thread Valdis . Kletnieks
On Fri, 22 Mar 2013 13:41:25 +0800, ishare said: Is it needed or must to compile fs and driver with -O2 option when compiling kernel ? It's not strictly mandatory to use -O2 (for a while, -Os was the default). There are a few places that for correctness, you *cannot* use -O0. For instance,

Re: optimization in kernel compile

2013-03-22 Thread Valdis . Kletnieks
On Fri, 22 Mar 2013 22:32:40 +0800, ishare said: are a few places that for correctness, you *cannot* use -O0. For instance, a few places where we use builtin_return_address() inside an inline (-O0 won't inline so builtin_return_address() ends up returning a pointer to a function when we

Re: optimization in kernel compile

2013-03-22 Thread Valdis . Kletnieks
On Fri, 22 Mar 2013 10:52:56 -0400, valdis.kletni...@vt.edu said: No debug information is stripped by -O2. Debug information isn't emitted if you don't compile with -g. At one time, long ago (quite possibly literally before you were born for some of the younger readers on the list), gcc was

Re: BFQ: simple elevator

2013-03-22 Thread Valdis . Kletnieks
On Fri, 22 Mar 2013 13:53:45 -0700, Raymond Jennings said: The first heap would be synchronous requests such as reads and syncs that someone in userspace is blocking on. The second is background I/O like writeback and readahead. The same distinction that CFQ completely makes. Again, this

Re: initramfs.cpio

2013-03-24 Thread Valdis . Kletnieks
On Sun, 24 Mar 2013 16:27:27 +0800, ishare said: Hi : I find that my initramfs_data.cpio generated by gcc does not contain init files ,which should be executed by terminal initialization. My initramfs_data.cpio only contains these : /dev /dev/consol /root . where to

Re: cap on writeback?

2013-03-25 Thread Valdis . Kletnieks
On Mon, 25 Mar 2013 16:33:48 -0700, Raymond Jennings said: Just curious, is there a cap on how much data can be in writeback at the same time? I'm asking because I have over a gigabyte of data in dirty, but during flush, only about 60k or so is in writeback at any one time. Only a gigabyte?

Re: cap on writeback?

2013-03-25 Thread Valdis . Kletnieks
On Mon, 25 Mar 2013 17:23:40 -0700, Raymond Jennings said: Is there some sort of mechanism that throttles the size of the writeback pool? There's a lot of tunables in /proc/sys/vm - everything from drop_caches to swappiness to vfs_cache_pressure. Note that they all interact in mystical and

Re: initramfs_list

2013-03-27 Thread Valdis . Kletnieks
On Wed, 27 Mar 2013 20:38:54 +0800, ishare said: I am do some test on kernel 2.6.0 and encountering an problem about initramfs . I find my initramfs generated without a initramfs_list file ,which describes the list of files that will be created into the initramfs file . such as

Re: Creating mkfs for my custom filesystem

2013-03-29 Thread Valdis . Kletnieks
On Fri, 29 Mar 2013 15:44:49 +0530, Sankar P said: I have decided on a simple layout for my filesystem where the first block will be the super block and will contain the version information etc. The second block will contain the list of inodes. Third block onwards will be data blocks. Each

Re: Online migration of arbitrary filesystems, possible?

2013-03-29 Thread Valdis . Kletnieks
On Fri, 29 Mar 2013 17:09:14 -0300, Daniel Hilst said: The idea is, mount both filesystems together, and make write/read operations go on this way Read operations: 1. See if data is already on dest fs, 2. If is then read data and bright back to caller (lets call this cold read)

Re: why not choose another way to define the _IOC_xxxMASK related to the ioctl

2013-03-30 Thread Valdis . Kletnieks
On Sat, 30 Mar 2013 18:01:32 +0800, RS said: Now I think this will spend more time than the kernel code when executed. Have you actually examined the generated code on several popular architectures to see what gcc actually does? (hint - many things can constant-folded at compile time. So if

Re: what does it use two !!

2013-04-01 Thread Valdis . Kletnieks
On Mon, 01 Apr 2013 15:10:46 +0800, Ben Wu said: 1 I found some placeuse two !!, what's means     if(button-gpio != INVALID_GPIO)         state = !!((gpio_get_value(button-gpio) ? 1 : 0) ^ button-active_low);     else Gaah. That line of code fell out of the ugly tree and hit every branch on

Re: Reading linux boot args

2013-04-02 Thread Valdis . Kletnieks
On Tue, 02 Apr 2013 12:12:09 +0900, manty kuma said: Is there any way i could read the reason for reboot. I want to read it so that i can get the reason that is stored. like 0xABADBABE is watchdog 0xCODEDEAD is panic. Etc.. Please suggest an alternative approach. See the 'pstore'

Re: cgroup.procs versus tasks (cgroups)

2013-04-02 Thread Valdis . Kletnieks
On Tue, 02 Apr 2013 16:46:24 +0300, Kevin Wilson said: Hi, Thanks a lot Vlad. This explains it. - Does anybody know of a ps command (or a filter to ps command) which will display only multithreaded processes (list processes by TGID) ? (I know now about the option of displaying

Re: Online migration of arbitrary filesystems, possible?

2013-04-02 Thread Valdis . Kletnieks
On Mon, 01 Apr 2013 17:50:43 -0300, Daniel Hilst said: Any reason you can't just 'rsync /source-fs /dest-fs'? because I can't use dest-fs while rsynching Sure you can. You just have to remember to pay attention to race conditions - if you create foo/bar.dat on the dest and then rsync wants

Re: Method to calculate user space thread size

2013-04-03 Thread Valdis . Kletnieks
On Wed, 03 Apr 2013 14:03:40 +0530, naveen yadav said: I have code written, and I cannot modify. I want to fix user stack size for all threads in glibc, 'man ulimit'? pgp5JyPP87h7J.pgp Description: PGP signature ___ Kernelnewbies mailing list

Re: NMIs, Locks, linked lists, barriers, and rculists, oh my!

2013-04-03 Thread Valdis . Kletnieks
On Wed, 03 Apr 2013 19:08:45 -0700, Arlie Stephens said: - I've got a linked list, with entries occassionally added from normal contexts. - Entries are never deleted from the list. This is already busted - you *will* eventually OOM the system this way. This would be simple, except that the

Re: simple question about the function memcmp in kernel

2013-04-07 Thread Valdis . Kletnieks
On Mon, 08 Apr 2013 08:57:01 +0800, Ben Wu said: int memcmp(const void *cs, const void *ct, size_t count) { I want to know why it use the temp pointer su1, su2? why it doesn't directly use the cs and ct pointer? This is a C 101 question, not a kernel question. But anyhow.. They're

Re: simple question about the function memcmp in kernel

2013-04-07 Thread Valdis . Kletnieks
On Mon, 08 Apr 2013 05:56:29 +0400, Max Filippov said: const is the the object they point to, not the pointers themselves (that would be void * const cs). memcmp compares bytes at which cs and ct point, but these are void pointers, and the expression res = *cs - *ct is thus meaningless.

Re: How will Linux community support the coming Intel new chip Bay Trail?

2013-04-11 Thread Valdis . Kletnieks
On Thu, 11 Apr 2013 23:08:21 +0800, Peter Xu said: Hi, all, It seems that Intel will publish a nice chip called Bay Trail (or plus, I don't quick sure, which is for smartphones/tablets, also some lower ends of laptops in the future). It was said publically that Intel will support Linux

Re: net_device: limit rate ot tx packets

2013-04-14 Thread Valdis . Kletnieks
On Sun, 14 Apr 2013 10:09:54 +0200, mic...@michaelblizek.twilightparadox.com said: This is not what I meant. When the qdisc has a size of say 256KB and the socket memory is, say 128kb, the socket memory limit will be reached before the qdisc limit and the socket will sleep. But when the

Re: So I want to get some kernel routine called....

2013-04-16 Thread Valdis . Kletnieks
On Tue, 16 Apr 2013 16:33:17 -0700, Arlie Stephens said: I have some kernel routine I'd like to get called, with the decision to call it made in user space. The proper answer here is *highly* dependent on exactly what this routine has to do once it's called. Can you explain the problem the

Re: Building kernel modules with debuginfo and printing line numbers in kernel oops message / coredump

2013-04-19 Thread Valdis . Kletnieks
On Fri, 19 Apr 2013 23:55:49 +0530, Sankar P said: myfunctionname +0x2507 +5679 That function is too honking big and needs to be refactored. :) pgp5Kg1q_h7vQ.pgp Description: PGP signature ___ Kernelnewbies mailing list

Re: oops in a kernel module

2013-04-28 Thread Valdis . Kletnieks
On Sat, 27 Apr 2013 19:34:00 +0300, Kevin Wilson said: Hello, static int __init init_zeromib(void) This is your init routine... { int ret = 0; printk(in %s\n,__func__); Missing KERN_DEBUG or similar here. This can cause it to fail to appear in dmesg output, causing much confusion.

  1   2   3   4   5   6   7   8   9   10   >