Why page fault handler behaved this way? Please help!

2014-10-30 Thread 秦弋戈



Dear all,


I am a kernel newbie who want's to learn more about memory management. Recently 
I'm doing some experiment on page fault handler. There happened something that 
I couldn't understand.


From reading the book Understanding the Linux Kernel, I know that the kernel 
loads a page as late as possible. It's only happened when the program has to 
reference  (read, write, or execute) a page yet the page is not in memory.


However, when I traced all page faults in my test program, I found something 
strange. My test program is large enough, but there are only two page faults 
triggered in the code segment of the program, while most of the faults are not 
in code segment.


At first I thought that perhaps the page is not the normal 4K page. Thus I 
turned off the PAE support in the config file. But the log remains unchanged.


So why are there only 2 page faults in code segment? It shouldn't be like this 
in my opinion. Please help me.


The attachment is my kernel log. Limited by the mail size, I couldn't upload my 
program, but I believe that the log is clear enough.


Thank you very much.
Best regards



kernel_log
Description: Binary data
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Query on the ci_udc driver for USB client implementation

2014-10-30 Thread Victor Ascroft
Hello, 

I am currently implementing USB Host and client support for Freescale Vybrid 
platform in u-boot. I managed to get the host implementation working. 

For the host side, usb start calls usb_init(), which in turns call, 
usb_lowlevel_init(), from there into the ehic_hcd_init() of my implementation. 
So, setting up the necessary clocks and plls for USB in my implementation and 
then setting up the usb_ehci, ehci_hccr and echi_hcor structures was all. The 
flow and setup required i was able to trace.

The USB client part is not clear to me. I was thinking i can use the ci_udc 
driver somehow to implement the client part. How can i use the ci_udc driver to 
implement client functionality?. From what i could see, the 
usb_gadget_driver_register() is suppose to be the first call. But, i couldn't 
trace from where this gets called or the flow and setup is suppose to be. OR Is 
a separate client driver required and nothing generic can be used akin to how 
it could be done for host?

Sorry if i am asking this question in the wrong place. I couldn't find anyone 
in the u-boot IRC channel nor find something similar to the kernel-newbies 
mailing list. 

Hope i am asking the right questions. Sorry if this mail ends up two times in 
this list, i mistakenly tried sending it from the mail ID not registered with 
this mailing list.

Thanks  Regards,
Sanchayan Maity.


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


How can I wake up one process from the wait queue?

2014-10-30 Thread Rock Lee
Hi, everyoneI am implementing a simple driver to experiment with wait queue.Two 
or more read processes block until a write process changes a flag and call 
wake_up_interruptible().I expect that a write process will only wake up one 
read process.However, once a write process calls  wake_up_interruptible() , all 
the read processes are awaken. How can I wake up one process from the wait 
queue? Here is the snippet of the simple dirver(just for experimenting, kernel 
2.6.18):
static ssize_t rlwait_read(struct file *filp, char __user *userp, size_t size, 
loff_t *off){struct rlwait_t *rock = (struct rlwait_t *)filp-private_data; 
   DECLARE_WAITQUEUE(wait, current);add_wait_queue(rock-r_wait_head, 
wait);while (rock-r_flag == 0) {
set_current_state(TASK_INTERRUPTIBLE);schedule();}   
remove_wait_queue(rock-r_wait_head, wait);
set_current_state(TASK_RUNNING);return 0;}
static ssize_t rlwait_write(struct file *filp, const char __user *userp, size_t 
size, loff_t *off){struct rlwait_t *rock = (struct rlwait_t 
*)filp-private_data;rock-r_flag = 1;
wake_up_interruptible(rock-r_wait_head);return size; }
Thans in advice.___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How can I wake up one process from the wait queue?

2014-10-30 Thread Pranay Srivastava
Hi

You got to use exclusive wait queues here. Needs a bit more lines but
you can specify exactly how many tasks you want woken up.

You should be able to look it up easily on how to use it.

On Thu, Oct 30, 2014 at 2:02 PM, Rock Lee rocklee_...@sina.com wrote:
 Hi, everyone

 I am implementing a simple driver to experiment with wait queue.Two or more
 read processes block until a write process changes a flag and call
 wake_up_interruptible().I expect that a write process will only wake up one
 read process.However, once a write process calls  wake_up_interruptible() ,
 all the read processes are awaken. How can I wake up one process from the
 wait queue? Here is the snippet of the simple dirver(just for experimenting,
 kernel 2.6.18):


 static ssize_t rlwait_read(struct file *filp, char __user *userp, size_t
 size, loff_t *off)

 {

 struct rlwait_t *rock = (struct rlwait_t *)filp-private_data;

 DECLARE_WAITQUEUE(wait, current);



 add_wait_queue(rock-r_wait_head, wait);



 while (rock-r_flag == 0) {

 set_current_state(TASK_INTERRUPTIBLE);

 schedule();

 }


 remove_wait_queue(rock-r_wait_head, wait);

 set_current_state(TASK_RUNNING);

 return 0;

 }


 static ssize_t rlwait_write(struct file *filp, const char __user *userp,
 size_t size, loff_t *off)

 {

 struct rlwait_t *rock = (struct rlwait_t *)filp-private_data;



 rock-r_flag = 1;

 wake_up_interruptible(rock-r_wait_head);



 return size;

 }


 Thans in advice.


 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




-- 
---P.K.S

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How can I wake up one process from the wait queue?

2014-10-30 Thread Raghavendra

On Thursday 30 October 2014 02:02 PM, Rock Lee wrote:


Hi, everyone

I am implementing a simple driver to experiment with wait queue.Two or 
more read processes block until a write process changes a flag and 
call wake_up_interruptible().I expect that a write process will only 
wake up one read process.However, once a write process calls 
wake_up_interruptible() , all the read processes are awaken. How can I 
wake up one process from the wait queue?


You can use exclusive wait queues, which wakes up only one process from 
the queue.


Although the general idea that is followed is: all the process are woken 
up once the resource is made available. And then the access to that 
resource is guarded by a lock, which in turn allows only one process to 
access the resource. Rest of the processes are pushed backed to sleep(or 
busy wait).


---
[ C-DAC is on facebook. Kindly follow us on the following url:  
https://www.facebook.com/CDACINDIA ]

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
---


---
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA  Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
---

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: [PATCH] staging: rtl8723au: Fix brace coding style issues reported by checkpatch

2014-10-30 Thread nick
I am trying to improve my rep first through.
Cheers Nick

On 14-10-30 12:21 AM, Sudip Mukherjee wrote:
 On Thu, Oct 30, 2014 at 5:34 AM, nick xerofo...@gmail.com wrote:
 I don't mind waiting. I am just honestly trying to improve my rep here and 
 actually(hopefully) get a job
 doing this full time.
 
 great , even if i want to get into a job where i can do this full time
 , and hopefully everyone here does,
 I dont want to discourage you , but considering your reputation (all
 over the world - maybe even outside this world) , that might be
 difficult.
 
 Cheers Nick

 On 14-10-29 04:45 AM, Scott Lovenberg wrote:
 On Wed, Oct 29, 2014 at 1:48 AM, Sudip Mukherjee
 sudipm.mukher...@gmail.com wrote:
 On Wed, Oct 29, 2014 at 11:38 AM, Scott Lovenberg
 scott.lovenb...@gmail.com wrote:
 On Wed, Oct 29, 2014 at 12:05 AM, Sudip Mukherjee
 sudipm.mukher...@gmail.com wrote:

 On Wed, Oct 29, 2014 at 7:31 AM, nick xerofo...@gmail.com wrote:
 Greg,
 That's fine, I was wondering how long Greg KH takes to get around to 
 picking this up as he is very busy with
 other kernel work.

 it might take a long long time. i think he is very busy now. I have
 not seen his replies to patches in the kernel list for atleast last 3
 weeks.

 [snip]

 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



 Nah.  Greg KH is a robot.  I'm firmly convinced that man doesn't
 sleep.  If I didn't know better, I'd think he's a Cylon.
 well said.

 On a serious note; realistically, a two week window isn't unheard of
 for getting your patches to mainline.  So long as you're not trying to

 mine is three weeks going on now. somehow i have managed to send my
 patches just at the beginning of the merge window.  :(
 yesterday i saw Greg K-H releasing the stable patches , so i guess now
 he will be seeing the pending staging patches.

 It also depends on how many hops you are to the maintainer and how
 heavy their workload is.  Sometimes you can directly submit to them,
 other times your patches will be passed through three trees before
 they see mainline.  It all depends on what you're working on and who's
 in your circle.


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


回复:Re: How can I wake up one process from the wait queue?

2014-10-30 Thread Rock Lee
Hi, Raghavendra, pranjas:
Thanks for your reply, add_wait_queue_exclusive() is perfect.
- 原始邮件 -
发件人:Raghavendra ar...@cdac.in
收件人:kernelnewbies@kernelnewbies.org
主题:Re: How can I wake up one process from the wait queue?
日期:2014年10月30日 16点52分


  
  
On Thursday 30 October 2014 02:02 PM,
  Rock Lee wrote:



  Hi, everyone
  I am implementing a simple driver to experiment with wait
queue.Two or more read processes block until a write process
changes a flag and call wake_up_interruptible().I expect that a
write process will only wake up one read process.However, once a
write process calls  wake_up_interruptible() , all the read
  processes are awaken. How can I wake up one process
from the wait queue?

  

You can use exclusive wait queues, which wakes up only one process
from the queue.



Although the general idea that is followed is: all the process are
woken up once the resource is made available. And then the access to
that resource is guarded by a lock, which in turn allows only one
process to access the resource. Rest of the processes are pushed
backed to sleep(or busy wait).

  
---


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


sched_clock generic for all architectures

2014-10-30 Thread Hemanth Kumar
Hi Gerg,

I want know why this two commit id is not backported v3.10 


1 . sched_clock: Make ARM's sched_clock generic for all architectures
2 . arch_timer: Move to generic sched_clock framework

where as the 1 commit is already backported v3.11

I back ported these two commit id 3.10 arm cortex-a9 boot's fine,
Is there any issue with this commit's if it is backported to v3.10.

Regards,

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies