Re: Set the ACPI=on on the cmdline, and the OS can not boot.

2015-09-10 Thread Valdis . Kletnieks
On Thu, 10 Sep 2015 17:41:51 +0800, tianlilai said: > When I set the ACPI=on on the cmdline,and the OS can not boot(If set > ACPI=off, The system is OK). The attachmemt file is the booting log. Would > help me slove this ploblem? Thanks very much. > Note:kernel version v2.6.18,and the arch

Re: Preceding a method call with (void)

2015-09-10 Thread Valdis . Kletnieks
On Thu, 10 Sep 2015 07:52:49 +0300, Kevin Wilson said: > (void) myFunc(param1); > > I did not encounter such cases in the kernel code that I read, thus far. > > On the other hand, I did not saw in the kernel coding style doc > anything which prohibits such usage. > > If I remember, using (void)

Re: Eudyptula task 2

2015-09-08 Thread Valdis . Kletnieks
On Tue, 08 Sep 2015 20:08:57 -0600, Yacdaniel Hurtado GarcC-a said: > atm i get this kernel version: 4.2.0-rc8 i dont know if i am doing > something wrong.Thanks You may or may not be doing something wrong. But you're probably no longer doing the Eudyptula challenge. :) pgp7sH4uoAi2S.pgp

Re: How to get the dentry value - no path_lookup

2015-09-07 Thread Valdis . Kletnieks
On Mon, 07 Sep 2015 12:10:56 +0530, Pria Mn said: > return valid dentry value. My requirement is to fetch directory name from > filepath. First off, unless this is a class assignment, your *requirement* isn't to fetch a directory name. Fetching the directory name is a *solution* you're thinking

Re: Problem with line discipline in new kernels

2015-08-23 Thread Valdis . Kletnieks
On Sun, 23 Aug 2015 10:14:20 +0300, Ruth Glushkin said: On Thu, 22 Aug 2015 00:21:00 -, Valdis Kletnieks said: Sounds like a reference counting problem. As far as I know, reference counter for line discipline sets to 0 in tty_register_ldisc(), Not for the discipline, for the *MODULE

Re: Oops: Kernel access of bad area, sig: 11 [#1]

2015-08-23 Thread Valdis . Kletnieks
On Sun, 23 Aug 2015 05:51:12 -, Ramon Fried said: Unable to handle kernel paging request for data at address 0xffdc Hmm.. Somebody missed an IS_ERR() macro? That's a -22, -EINVAL. pgpmL5yEu0Nbk.pgp Description: PGP signature ___

Re: Problem with line discipline in new kernels

2015-08-21 Thread Valdis . Kletnieks
On Thu, 13 Aug 2015 13:00:58 -, Margarita Glushkin said: I have a linux kernel driver for serial device, which uses line discipline and char device. Driver works with all old kernels, starting from 3.8 this driver still works, but when I unload it and load again to the memory (modprobe -r

Re: Fwd: is it possible to liimit the softirq re entrance times

2015-08-21 Thread Valdis . Kletnieks
On Fri, 21 Aug 2015 01:12:10 +0800, vichy said: if no, isn't it possible to make starvation in above a and b? Operating systems have to make design choices. You run with IRQs disabled for too long, you can starve other IRQs waiting for service. You run with them mostly enabled, the one

Re: Safety in Kernel Development

2015-08-21 Thread Valdis . Kletnieks
On Tue, 18 Aug 2015 21:58:15 +0800, 慕冬亮 said: Since I knew that Linux kernel didn't accept the pax/grsecurity , but wrote its own implement, and some linux developers do not have sense of security, I think linux security will be a problem in the future. The fact that a specific security

Re: Comprehensive Linux API manual by subsystem Required

2015-08-21 Thread Valdis . Kletnieks
On Fri, 21 Aug 2015 00:48:26 -0400, Aruna Hewapathirane said: I am developing a user space program which interacts with file system https://www.kernel.org/doc/htmldocs/filesystems/index.html and cryptography https://www.kernel.org/doc/htmldocs/crypto-API/index.html The best documentation

Re: What Next After Char, Block, Serial Parallel Drivers

2015-08-13 Thread Valdis . Kletnieks
On Tue, 11 Aug 2015 17:48:16 -, Sasha Mckinsey said: What should be the next steps besides looking for a job. That's for *you* to decide, not for us to suggest. Do authors go around asking What sort of book should I write? No - because unless the author was interested in writing a gothic

Re: Kernel options to boot root over NFS

2015-08-07 Thread Valdis . Kletnieks
On Fri, 07 Aug 2015 22:38:11 -, Nestor Waldyd said: but all this *withouth* success. You really need to be more specific regarding its failure to succeed. Did you run a tcpdump to see the traffic? How far did it get? Did it pxeboot? Did it successfully DHCP itself an address, or did it

Re: debugging kernel module __init function?

2015-08-04 Thread Valdis . Kletnieks
On Tue, 04 Aug 2015 12:23:18 -0700, Nicholas Murphy said: How do I debug the __init function (that is called on module load)? Is your .init function actually doing so much odd stuff that a few carefully placed printk() calls aren't sufficient? pgpAYpKItGKDg.pgp Description: PGP signature

Re: can't create lttng-modules

2015-08-03 Thread Valdis . Kletnieks
On Mon, 03 Aug 2015 18:34:05 +0300, Jacob Gonik said: For the first time, i activated : # bitbake -c compile lttng-modules , and it fetches the source code. I would like to have a clue or direction to solve this. Does the compile step produce any logs/output? Did you check the output for

Re: Fwd: USB Driver - Device No Response standard compliant

2015-08-01 Thread Valdis . Kletnieks
On Sun, 02 Aug 2015 00:04:44 -0300, Christian N said: I know that the presentation of the message is the responsibility of the application (user space), but to do this is necesary an event from usb driver (I think it). A timeout with no activity at all can do it.. That's Userspace C 101 -

Re: shared memory via /dev/shm?

2015-07-31 Thread Valdis . Kletnieks
On Fri, 31 Jul 2015 16:16:14 -0700, Nicholas Murphy said: Hmm…I suppose not. I’d would still be curious what the right way to do this is, though? I think I can get away with that trick, but I can also imagine scenarios where I’d want the kernel module itself to create the file. In

Re: shared memory via /dev/shm?

2015-07-30 Thread Valdis . Kletnieks
On Thu, 30 Jul 2015 16:03:51 -0700, Nicholas Murphy said: Yes, I’ve read all the disclaimers against accessing files in the kernel, but I want to set up a shared memory segment between a kernel module and one or more user processes, and /dev/shm seems like a good way to do that. Is there

Re: how can I find where is the macro or function deifined

2015-07-28 Thread Valdis . Kletnieks
On Tue, 28 Jul 2015 23:54:36 -, Gnoleba GNOGBO said: Can you give a procedure step by step please to answer please ? http://www.lmgtfy.com/?q=ctags+vim+tutorial http://www.lmgtfy.com/?q=ctags+emacs+tutorial pgpdWdmIZQnYO.pgp Description: PGP signature

Re: Please do not generate patches purely based on checkpatch.

2015-07-26 Thread Valdis . Kletnieks
On Sun, 26 Jul 2015 13:05:37 +0530, Yogesh Chaudhari said: However, is there a place which documents which maintainers(and/or sub-systems) accept checkpatch(or other cleanup related) patches and who will reject them outright? Wouldn't it be good to have this documented, especially given that

Re: HOSTAPD Error log

2015-07-23 Thread Valdis . Kletnieks
On Thu, 23 Jul 2015 12:31:18 +0530, Amit Gupta said: Configuration file: /etc/hostapd.conf [ 199.672712] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Failed to update rate sets in kernel module [ 199.687566] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready Using interface

Re: Fuzzing scheduler CFS

2015-07-22 Thread Valdis . Kletnieks
On Wed, 22 Jul 2015 10:30:47 +0300, Meyer Lansky said: I would like to improve the code, but has not found a practical method of finding errors. Bugs in the scheduler almost always manifest in one of two ways: 1) Truly spectacular crashes or hangs where you *know* you've found a bug. 2) Find

Re: Obfuscate code GPL 2 - The source uses kernel structs and GPL2 API

2015-07-21 Thread Valdis . Kletnieks
On Tue, 21 Jul 2015 15:49:22 -0300, Lucas Tanure said: Hi, This company released a obfuscated kernel module in GPL 2. http://www.incentivespro.com/downloads.html So, they didn't release the code at all. This is ok ? This against the law ? We're code hackers here. If the

Re: Obfuscate code GPL 2 - The source uses kernel structs and GPL2 API

2015-07-21 Thread Valdis . Kletnieks
On Tue, 21 Jul 2015 20:13:48 -, Jeff Haran said: But it seems to me that if it builds, then they’ve released the code. No - the GPLv2 says: The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means

Re: goto???

2015-07-17 Thread Valdis . Kletnieks
On Fri, 17 Jul 2015 10:48:53 +0200, Martin Knappe said: Very easy: On Fri, 17 Jul 2015 11:40:00 +0200, Martin Knappe said: Like so: On Fri, 17 Jul 2015 11:44:34 +0200, Martin Knappe said: Sorry, have to correct my solution. You need to add cleanupState = 0 just before the finish, like so: I

Re: Configuration settings for WM8850 wolfson audio codec

2015-07-15 Thread Valdis . Kletnieks
On Wed, 15 Jul 2015 12:26:29 +0530, bineet said: I need to check setting done for WM8850 wolfson audio codec chip. I tried browsing linux code, but couldn't find any clue. Could someone please help with the same? Hmm.. are you sure it's an audio codec chip? WMB8850 appears to be an entire

Re: About Low Hanging Fruits

2015-07-14 Thread Valdis . Kletnieks
On Mon, 13 Jul 2015 13:11:57 -0400, Robert P. J. Day said: actually, one area of low-hanging fruit is the Documentation/ directory, which could always use some attention. documentation is always getting out of date, so pick a subsystem and clean up the docs. Good catch, I'll add it to my

Re: About Low Hanging Fruits

2015-07-13 Thread Valdis . Kletnieks
On Mon, 13 Jul 2015 12:13:28 +0530, Mayur Patil said: I just want to know like other Open source projects is there a thing in linux kernel as Low hanging fruits. The Linux kernel has been worked over by professional programmers for more than a decade, and as a result the number of things

Re: Knowledge of Protocols

2015-07-09 Thread Valdis . Kletnieks
On Thu, 09 Jul 2015 17:56:15 -, Mohit . said: I would like to know what do statements like the following mean - Have knowledge of Protocols such as TCP/IP, IPSec, IPV6 or SSL Does it mean to have a theoretical view of the facets which constitute the protocol which can be done by

Re: Changel anguage

2015-07-03 Thread Valdis . Kletnieks
On Sat, 27 Jun 2015 10:57:18 -, Gnoleba GNOGBO said: I would like to change my language to french please. Feel free to do so. However, note that although almost everybody in the kernel community can manage enough English to make themselves understood, relatively few are proficient in

Re: Kernel contributions from organisations and individual privacy

2015-06-14 Thread Valdis . Kletnieks
On Fri, 12 Jun 2015 23:29:51 -, Jeff Haran said: Seems like unless there is some monetary sting like a piece of the proceeds on the sale of violating products, You know what's an even bigger monetary sting than having to pay a percentage? A court order banning the sale of your product

Re: Kernel contributions from organisations and individual privacy

2015-06-14 Thread Valdis . Kletnieks
On Sun, 14 Jun 2015 17:25:40 -0400, Nicholas Krause said: Why are we even trying to prove this, it seems any intelligent company who has a interest in staying in business will comply The problem is companies that have mixed in their own secret sauce, and are afraid of said sause becoming

Re: Kernel contributions from organisations and individual privacy

2015-06-14 Thread Valdis . Kletnieks
On Sun, 14 Jun 2015 19:36:23 -0400, nick said: a embedded version of Linux called NX OS I believe and its all open to my knowledge. Again this is stupidity in my option or companies being lazy by hiding there terribly written drivers. Remember Nick - it's not a technical decision, it's a

Re: Kernel contributions from organisations and individual privacy

2015-06-12 Thread Valdis . Kletnieks
On Fri, 12 Jun 2015 00:39:21 -0400, Ruben Safir said: those lawsuites would be challenged for law of standing. I do believe that has *never* been much of a problem for the guys at gpl-violations.org - it's pretty much a slam dunk: 1) You distributed the kernel without source. 2) The kernel is

Re: Kernel contributions from organisations and individual privacy

2015-06-11 Thread Valdis . Kletnieks
On Thu, 11 Jun 2015 19:26:23 -0400, Ruben Safir said: Lets say Apple decides that are going to take the Linux Kernel and alter it extensively, in order for it to work with a new hardware platform that they created. And lets say don't return the code base to the public. Now who is going to

Re: About Minimum HDD size for Kernel Compilation

2015-06-05 Thread Valdis . Kletnieks
On Fri, 05 Jun 2015 15:19:54 +0530, Mayur Patil said: If I have downloaded any kernel from kernel.org site, I want to install it how much *minimum size of H I require to compile and install it*? Well... the kernel I'm running now compiles in only 2.6G of disk space. The fun is what

Re: Change proc/pid/cmdline to 8k

2015-06-04 Thread Valdis . Kletnieks
On Fri, 05 Jun 2015 07:07:30 +0900, Greg KH said: Applications shouldn't be messing around with the kernel command line. He's looking at /proc/PID/cmdline, which is a different beast. Presumably, he's looking at 'ps axwww' and still not seeing the full process commandline, and that

Re: Change proc/pid/cmdline to 8k

2015-06-04 Thread Valdis . Kletnieks
On Thu, 04 Jun 2015 21:06:10 +0530, Navin P said: have this 3rd party application with deeply mounted dir that runs as a testcase more than 5k chars . We can change it , i thought if that was the problem ? So why is a long commandline a problem that needs solving? Are you actually caring what

Re: unlocking the recv

2015-06-03 Thread Valdis . Kletnieks
On Wed, 03 Jun 2015 12:42:28 +0200, Grzegorz Dwornicki said: Server callend the recv function and waits for the data from client soo its blocked in wait_queue. The socket is in nonblocking state. Can this proces/thread be unblocked on demand? Umm... according to the manpage for 'man 2 recv':

Re: idle task check

2015-06-02 Thread Valdis . Kletnieks
On Tue, 02 Jun 2015 23:38:48 +0200, Mustafa Hussain said: /*Check if the pointer pointing to the idle class is equal to prev's sched_class*/ if(prev-sched_class == idle) After this condition you can just: printk(KERN_INFO Prev is equal to idle_sched_class,now running the idle

Re: Stop usbhid from claiming usb device on hotplug

2015-06-01 Thread Valdis . Kletnieks
On Sun, 31 May 2015 21:31:20 -0400, Nicholas Krause said: Your right, questions about eucalyptus based tasks should be asked off list to avoid people getting easy answers through. No, the rules are to do it *on your own*, without asking anybody, on or off list. However I think a lot of this

Re: Stop usbhid from claiming usb device on hotplug

2015-05-31 Thread Valdis . Kletnieks
On Sun, 31 May 2015 20:39:06 -0400, Nicholas Krause said: If you send your complete code to the list I can try and see if there are other issues but that's the most likely. Actually, he shouldn't send it to the list. It smells too much of eucalyptus pgp53YP95B7DJ.pgp Description: PGP

Re: Stop usbhid from claiming usb device on hotplug

2015-05-30 Thread Valdis . Kletnieks
On Sat, 30 May 2015 04:07:08 -0400, Armin Moradi said: had done, but while I was reading LDD 3rd ed., I also wanted to get probing to work which is done after the driver is already loaded. If it's a dummy driver, what device is it going to probe? pgpjCAtYiBnL6.pgp Description: PGP signature

Re: Will make modules_install replace old kernel modules?

2015-05-27 Thread Valdis . Kletnieks
On Thu, 28 May 2015 11:26:02 +0800, Gao Peng said: I am not sure if I boot from the old kernel,will the old kernel load the new-installed modules or keep it's own modules. If you did it properly, then you should have 2 kernels, each with a distinct value for uname -r, and 2 directories under

Re: when I subscribe linux-kernel mailing list , There is not any resposes! Why?

2015-05-20 Thread Valdis . Kletnieks
On Wed, 20 May 2015 08:44:03 +0800, sizel said: when I subscribe linux-kernel mailing list , There is not any resposes! Why? I believe that the mailing list management software is set up to require a confirmation - you should have received a Click here to confirm mail in response to your

Re: Documentation for usbmouse.c

2015-04-29 Thread Valdis . Kletnieks
On Thu, 30 Apr 2015 09:56:23 +0530, Ronit Halder said: Where do i get documentation for usb mouse ( usbmouse.c ).I was reading /home/roni/linux/drivers/hid/usbhid/usbmouse,c and i am unable to understand some part of it.So,i need help. Which parts *specifically* are you confused about and

Re: 4.1-rc1 fails with O3 optimization

2015-04-28 Thread Valdis . Kletnieks
On Tue, 28 Apr 2015 01:41:07 -0400, Andev said: Look here: http://www.spinics.net/lists/kernel/msg1962561.html I may have blinked - did you happen to mention what gcc release you are using? pgpjBkGi3Bqyw.pgp Description: PGP signature ___

Re: 4.1-rc1 fails with O3 optimization

2015-04-28 Thread Valdis . Kletnieks
On Tue, 28 Apr 2015 17:17:37 -0400, Andev said: On Tue, Apr 28, 2015 at 4:29 PM, valdis.kletni...@vt.edu wrote: On Tue, 28 Apr 2015 01:41:07 -0400, Andev said: Look here: http://www.spinics.net/lists/kernel/msg1962561.html I may have blinked - did you happen to mention what gcc release

Re: How to get kernel header from my kernel source tree?

2015-04-27 Thread Valdis . Kletnieks
On Mon, 27 Apr 2015 17:40:11 +0800, tianlilai said: Hi,Everyone: I have updated the kernel from v2.6.32 to v2.6.36 Do yourself and your developers a great service, and do the following: 1) Upgrade to v4.0 (recently released). 2.6.36 is almost 5 years old. 2) Get your driver module in-tree.

Re: How to traverse all file struct

2015-04-27 Thread Valdis . Kletnieks
On Tue, 28 Apr 2015 00:58:47 -, cmqycmqy said: (Again, depending I just want to print process info whitch have open a specific file£¨inode£©. Then if i want to delete a file in use,i can just kill the process one by one. No kernel hacking needed for that, you can do it in userspace. #

Re: How to traverse all file struct

2015-04-27 Thread Valdis . Kletnieks
On Mon, 27 Apr 2015 15:41:31 -, cmqycmqy said: I want to travese(find out) all opened file struct Actually, no, you don't. i want to find out all process that have open that file. Hint: There's probably a faster way to do it than checking *all* open files. You can probably do even better

Re: task deactivation

2015-04-26 Thread Valdis . Kletnieks
On Sat, 25 Apr 2015 19:17:13 +0200, Mustafa Hussain said: what the function deactivate_task() exactly do ? thanks in advance. void deactivate_task(struct rq *rq, struct task_struct *p, int flags) { if (task_contributes_to_load(p)) rq-nr_uninterruptible++;

Re: Structure declaration without its members variables

2015-04-26 Thread Valdis . Kletnieks
On Mon, 27 Apr 2015 00:16:59 +0530, harshkdev said: struct kvm; struct kvm_vcpu; Generally we declare structure and its member at same place. It's a forward declaration. Consider two structures that have pointers to each other: struct a { int b, c, d; struct *b b_ptr; } struct

Re: Basic question about malloc

2015-04-22 Thread Valdis . Kletnieks
On Thu, 23 Apr 2015 09:52:56 +0800, 慕冬亮 said: I'm looking for that whether the object allocated by malloc is the multiple of certain bytes! Or how does the malloc allocate dynamic memory ?? I does an experiment in my computer! 1) malloc() is a userspace function, not

Re: Achieve multi-threading in MIPS assembly

2015-04-20 Thread Valdis . Kletnieks
On Tue, 21 Apr 2015 01:05:19 -, Chaturvedi, Akash said: I am writing MIPS assembly code for a 'Word guessing game'. Why? gcc -O2 will almost certainly generate faster code than you can (unless you're *really* good at MIPS assembler, in which case you wouldn't have posted).

Re: How do _you_ read the linux source?

2015-04-20 Thread Valdis . Kletnieks
On Mon, 20 Apr 2015 07:45:37 +0200, Christoffer Holmstedt said: Thank you Nick, I'm just getting started with linux kernel development and have been looking around for books both more general and specific to networking. One thing in common several books I've found have is that they are based

Re: Kernel thread scheduling

2015-04-16 Thread Valdis . Kletnieks
On Thu, 16 Apr 2015 14:28:59 -0400, Ruben Safir said: Others may come to different conclusions. I use www.google.com on a regular basis even though I can't download it. That is not even a good analogy. We're comparing closed Coverty-as-a-service with closed Google-as-a-service. Seems like

Re: Heap Management Problem

2015-04-15 Thread Valdis . Kletnieks
On Wed, 15 Apr 2015 12:28:06 +0800, 慕冬亮 said: Can you give a detail of what you want to prove? I am not familiar with heap management , so I ask for the details! As I said - heap management is usually mostly done in userspace. The way the standard glibc malloc() call does things is

Re: Heap Management Problem

2015-04-14 Thread Valdis . Kletnieks
On Tue, 14 Apr 2015 23:01:58 +0800, 慕冬亮 said: Hello Everyone: What's the rule about heap management? Especially what's the function of do_brk? Who says there's a rule about it? Some userspace heap managers don't even *use* brk() or sbrk(), but instead use mmap() of an anonymous

Re: RT process priority Interrupts ?

2015-04-09 Thread Valdis . Kletnieks
On Thu, 09 Apr 2015 15:30:42 +0900, manty kuma said: A missed IRQ is not considered fatal but where as missing the upper time Are you *sure* that ignoring an IRQ for an arbitrarily long time is non-fatal? (Hint - it may not be fatal to the *kernel*. Think bigger) limit for an RT process

Re: pci devices

2015-04-09 Thread Valdis . Kletnieks
On Wed, 08 Apr 2015 22:18:46 -0700, A B said: One of my pci device is not showing up in /proc/pci/bus/devices. I'm using 2.6.36 kernel. which part of code i can look to troubleshoot, i'm looking at drivers/pci/probe.c. Any pointers / tips will be helpful Wow. If the device isn't even showing

Re: RT process priority Interrupts ?

2015-04-08 Thread Valdis . Kletnieks
On Thu, 09 Apr 2015 10:59:20 +0900, manty kuma said: In Linux, when a real time process is executing and an interrupt comes, will the RT process be preempted? Is RT process considered superior to interrupts? Think it through - that would imply that RT processes effectively run with interrupts

Re: VFS/driver core overhead

2015-04-07 Thread Valdis . Kletnieks
On Mon, 06 Apr 2015 23:12:34 -0400, nick said: (Replying mostly for the edification of those who can learn learn without having to be spoon-fed) After reading through the code for the usb and vfs core infrastructure, I was wondering if after reading it if I am correct in my notion of there

Re: Learning things

2015-04-06 Thread Valdis . Kletnieks
On Mon, 06 Apr 2015 10:43:46 -0700, Joris Bolsens said: I'm working on trying to teach myself C and was wondering if you had any kernel specific recommendations. Don't bother trying until you have an actual good working knowledge of C. Work in userspace where your screw-ups just take the

Re: Reading kernel code

2015-04-05 Thread Valdis . Kletnieks
On Sat, 04 Apr 2015 23:30:49 -0400, Nicholas Krause said: Greetings All, I am interested someone testing me If you have to ask, the answer is No, you don't understand it. And you missed the *other* important part - why would anybody else be interested in doing said testing? What's in it for

Re: Help learning from my mistakes

2015-04-04 Thread Valdis . Kletnieks
On Sat, 04 Apr 2015 15:28:23 -0400, Nicholas Krause said: After reading this it seems that the issue is my lack of effort not my abilities. Being able to realize that the find|xargs grep solution was actually less work, with quicker results, is *itself* an ability. pgpTzoxe1Hx1g.pgp

Re: Help learning from my mistakes

2015-04-04 Thread Valdis . Kletnieks
On Sat, 04 Apr 2015 19:00:42 -0400, Nicholas Krause said: are now slower by up to 3 times, So what debugging did you already do to try to narrow this down? Did you even run 'top' or 'vmstat' or anything else like that? Did you check to make sure you didn't replace a stripped down custom config

Re: Help learning from my mistakes

2015-04-03 Thread Valdis . Kletnieks
On Fri, 03 Apr 2015 17:23:04 -0400, Nicholas Krause said: Greetings All, I am wondering if there are any stupid mistakes in my attempts at kernel programming I am still making. See the find|grep command I posted yesterday that you should have done before posting. pgper1mrydybG.pgp

Re: Function Pointer Question

2015-04-02 Thread Valdis . Kletnieks
On Thu, 02 Apr 2015 06:54:42 -0400, Nicholas Krause said: I looked in to it and the kernel seems to be one of the few places where this is done along with in line functions. Why do we need function pointers in the kernel, outside of device drivers is my real question and is there any way to

Re: mmap text file

2015-03-31 Thread Valdis . Kletnieks
On Tue, 31 Mar 2015 17:11:33 +0530, Ssagarr Patil said: Hi, while (loop) {         /* get the current file size of output file */         filesize = lseek(outfd, 0, SEEK_END);         /* Increase file size */         ftruncate(outfd, (off_t)filesize + (off_t)buf.size Are you sure you

Re: Questions about the zoned page frame allocator and fix mapped addresses

2015-03-30 Thread Valdis . Kletnieks
On Mon, 30 Mar 2015 20:25:38 +0530, Sunny Shah said: - The book says, about releasing page frames to the per CPU cache - no page frame is ever released to the cold cache: the kernel always assumes the freed page frame is hot with respect to the hardware cache. What is the reason

Re: Can add new module without upgrade the kernel?

2015-03-30 Thread Valdis . Kletnieks
On Mon, 30 Mar 2015 22:58:12 +0800, Woody Wu said: FFC3 3.1.0-ffc3mb-00050-g5874787 # pwd Wow. Git bisect gone incredibly wrong? How did you end up running *that* kernel? pgpBRMNZFGE_x.pgp Description: PGP signature ___ Kernelnewbies mailing list

Re: Writing driver for a net device which does not support interrupt

2015-03-23 Thread Valdis . Kletnieks
On Mon, 23 Mar 2015 18:51:51 +0800, Freeman Zhang said: I'm writing a net device driver for my final project in college. But the half-finished device doesn't support interrupt yet(those hardware guys...) So I'm wondering if there is some way to poll the device for its status and events. As a

Re: Is RCU not safe enough to protect dcache hlist?

2015-03-16 Thread Valdis . Kletnieks
On Mon, 16 Mar 2015 10:06:37 +0800, Lee said: I am studying the dcache in VFS recently . I found that hlist of dcache is already protected by RCU in __d_lookup.Is it necessary for the function -- d_lookup using sequence lock to protect the hlist again? RCU is useful when you can tolerate

Re: confusing code....whats the point of this construct ?

2015-03-12 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 17:46:56 +0100, Nicholas Mc Guire said: ret = ({ long __ret = (5*250); do { _cond_resched(); } while (0); if (!({ bool __cond = (({ Gaak. ret = wait_event_timeout(mgr-tx_waitq, check_txmsg_state(mgr,

Re: I am new here

2015-03-12 Thread Valdis . Kletnieks
On Thu, 12 Mar 2015 13:27:21 -0300, Leonardo Ariel Carreras Rodríguez said: I am new here, and I want to know how to get started, maybe with the simplest way available. Something the others haven't addressed - do you have an understanding of *why* you are here? As the how to get started will

Re: confusing code....whats the point of this construct ?

2015-03-11 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 18:37:32 -, Jeff Haran said: I don't understand the problem here. The caller passes in a condition to be evaluated in a loop. Many times that condition is quite simple (e.g. a counter being non-zero). If it was a function the caller would have to pass in a pointer to a

Re: Kernel Locking Question

2015-03-11 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 19:03:33 -0400, Nicholas Krause said: was wondering of how this would improve file system scalability and reliability if implemented in file system code for btrfs worker threads. Step 1: Figure out what locks are contended in actual systems. Step 2: Determine if the scope

Re: Tracing allocators of virtual memory and main memory

2015-03-11 Thread Valdis . Kletnieks
On Thu, 12 Mar 2015 07:09:32 +0530, SAHIL said: Yeah right, pidstat which read /proc gives me VSZ ans RSS but i need to backtrace when VSZ/RSS is high which indicates process is allocating memory which it is not even using. Do you mean pages it isn't *currently* using, or has *never* used?

Re: confusing code....whats the point of this construct ?

2015-03-11 Thread Valdis . Kletnieks
On Wed, 11 Mar 2015 15:17:44 +0100, Nicholas Mc Guire said: So the wait_event_timeout condition here ends up being (empty || skip) but what is the point of puting this code into the parameter list of wait_event_timeout() ? Would it not be equivalent to: bool empty; ...

Re: Question on mutex code

2015-03-10 Thread Valdis . Kletnieks
On Tue, 10 Mar 2015 14:03:59 +0100, Yann Droneaud said: Consider the following sequence of events: 0. Suppose a mutex is locked by task A and has no waiters. 1. Task B calls mutex_trylock(). 2. mutex_trylock() calls the architecture-specific __mutex_fastpath_trylock(), with

Re: Get local CPU id

2015-03-09 Thread Valdis . Kletnieks
On Mon, 09 Mar 2015 13:42:04 -0400, Nick Krause said: He can just limit the dmesg output by using console_limit I believe. Won't fly. Hint: How high to you have to set that limit to get through boot? What happens if the message is logged to a console? pgpTbC7mxUDBH.pgp Description: PGP

Re: getting interrupt number

2015-03-08 Thread Valdis . Kletnieks
On Mon, 09 Mar 2015 07:55:10 +0530, Ronit Halder said: How to get the interrupt number of a device.I know it's device id and the bus number. The device is a usb mouse. In that case, you won't find an interrupt number for the mouse, you'll find one for the USB controller the mouse is attached

Re: Get local CPU id

2015-03-08 Thread Valdis . Kletnieks
On Sun, 08 Mar 2015 22:49:00 +0100, Maxime Ripard said: On Sun, Mar 08, 2015 at 10:06:23PM +0300, Matwey V. Kornilov wrote: I would like to somehow obtain local CPU core ID in the interrupt handler function. I want to see how my interruptions are distributed among different CPU cores

Re: How to check if a file is a present in a directory(directly/indirectly)

2015-03-06 Thread Valdis . Kletnieks
On Fri, 06 Mar 2015 20:38:46 +0530, noyb noybee said: I am building a LKM in which I need to check whether a file is inside a particular directory(directly or inside sub-directories). Is there a function for this? Do I need to use the lookup function in inode_operations for this or is there a

Re: I want to remove my current kernel after upgradtion of new kernel

2015-03-03 Thread Valdis . Kletnieks
On Tue, 03 Mar 2015 17:12:44 +0530, Anurudh Tiwari said: I have to remove my current kernel(which is going to be old kernel in next reboot) after up-gradation because i don't want to get prompt to choose the kernel at booting time. Protip: You *really* want to keep at least one extra

Re: Port Newer Kernel to Android Device

2015-02-23 Thread Valdis . Kletnieks
On Mon, 23 Feb 2015 11:50:52 -0500, Nick Krause said: I was curious if this is possible. As other distros like Red Hat are very hard to port the patches to from the main line kernel. Forward porting the patches isn't much trouble - the Rawhide guys seem to be able to do that almost *every

Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sat, 21 Feb 2015 23:52:06 -0500, nick said: Greetings Fellow Kernel Developers, I was wondering if there is any way to port a newer kernel to my device without breaking the android user space. Yes. There is a way. pgpzS9yZaZKc6.pgp Description: PGP signature

Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sun, 22 Feb 2015 08:40:59 -0500, Nicholas Krause said: Validis, If that is the case , would you mind telling me how to do it. Step 1: Get good enough at kernel hacking to forward-port all the Android-specific patches. Those should be available to you from Samsung as they are GPL. Step 2:

Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sun, 22 Feb 2015 20:02:14 -0500, nick said: This is just a idea for now I haven't have the idea to look at making the porting patch(es) yet. Then it really doesn't matter how long it will take, because it's not likely to actually happen. So why you bothering to ask? pgpAmvwShZCA0.pgp

Re: Identify true error value for kernel API's like kmalloc() and ioremap()

2015-02-22 Thread Valdis . Kletnieks
On Mon, 23 Feb 2015 15:37:52 +0900, manty kuma said: If the call fails, the return value is NULL. So, how do I know what caused the failure? I have looked at examples in the kernel code. They are returning a hard-coded value of -ENOMEM if kmalloc() fails. Well.. say you call kmalloc() and it

Re: Port Newer Kernel to Android Device

2015-02-22 Thread Valdis . Kletnieks
On Sun, 22 Feb 2015 13:19:40 -0500, Nicholas Krause said: Validis, That was my concern. How much forward porting is required. That will depend on your actual skill level. That which is a long weekend's work for a master kernel hacker will be several week's work for a journeyman, a summer's

Re: sk_wait_data

2015-02-19 Thread Valdis . Kletnieks
On Thu, 19 Feb 2015 23:45:44 +0100, Grzegorz Dwornicki said: How does the kernel know when to unblock the process? Function name: sk_wait_data and macro name: sk_wait_event tells me that there should be some queue checning from time to time... No need to check the queue from time to time.

Re: executing insmod hangs the entire os

2015-02-18 Thread Valdis . Kletnieks
On Wed, 18 Feb 2015 12:33:57 +0530, noyb noybee said: Wasn't that implemented from version 3 and not 2.6? Another problem is you're developing against 2.6. ducks :) pgp226XpWyz1H.pgp Description: PGP signature ___ Kernelnewbies mailing list

Re: unlikely compiler flag propagation

2015-02-18 Thread Valdis . Kletnieks
On Wed, 18 Feb 2015 19:38:01 +0100, Nicholas Mc Guire said: On Wed, 18 Feb 2015, Greg KH wrote: interesting - would you have a reference to some talk/paper/data/... ? Test for yourself :) config PROFILE_ANNOTATED_BRANCHES bool Trace likely/unlikely profiler select

Re: executing insmod hangs the entire os

2015-02-17 Thread Valdis . Kletnieks
On Tue, 17 Feb 2015 21:46:00 +0530, noyb noybee said: am on a VM running CentOS 6.6 with kernel version 2.6.32-504. Which probably has kernel relocation and ASLR enabled. unsigned long *syscall_table = (unsigned long *)0x81600560; So that isn't pointing at the syscall table in the

Re: error: missing syscalls when compiling kernel module

2015-02-16 Thread Valdis . Kletnieks
On Mon, 16 Feb 2015 12:14:59 +0530, noyb noybee said: Hi all. This is the error that I am getting when I try to compile a loadable module(it tries to intercept a system call by directly editing the sys_call_table in the memory):- In general, that's a *really* bad idea, for numerous reasons.

Re: Fwd: Fwd: Getting path in inode_permission

2015-02-12 Thread Valdis . Kletnieks
On Thu, 12 Feb 2015 23:41:18 +0530, noyb noybee said: On Thu, Feb 12, 2015 at 3:44 AM, valdis.kletni...@vt.edu wrote: How about you concentrate on how were they able to access files outside the chroot in the first place? So, closing all open file descriptors that are outside the new root

Re: Fwd: Fwd: Getting path in inode_permission

2015-02-11 Thread Valdis . Kletnieks
On Thu, 12 Feb 2015 00:31:45 +0530, noyb noybee said: I was planning that the calling process would call the new system call which would return a pseudo-random key that is used as the pass-phrase. So what prevents malicious code from doing a fork and then calling the new syscall to get its

Re: Fwd: Fwd: Getting path in inode_permission

2015-02-11 Thread Valdis . Kletnieks
On Thu, 12 Feb 2015 03:19:46 +0530, noyb noybee said: Well, any program which has root credentials is still allowed to call chroot(it needs to get a new passphrase before) but not any program with root credentials can exit it. Well see... now you have a problem. If you don't allow that

Re: Fwd: Fwd: Getting path in inode_permission

2015-02-10 Thread Valdis . Kletnieks
On Wed, 11 Feb 2015 03:42:50 +0530, noyb noybee said: Apologies for the late reply. Plus the whole passphrase thing is probably equally easy to defeat. (Hint - how does the passphrase get passed to the kernel in the first place?) I am planning to create a new system call for that and I

<    1   2   3   4   5   6   7   8   9   10   >