LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-18-2014, 01:56 PM   #1
Tdjames
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Rep: Reputation: Disabled
Disable Lazy Preempt


Hey guys,

I'm pretty new to linux and working on getting a real-time kernel up and running for robot applications. I'm on Ubuntu 14.04, using kernel 3.14.3 and the 3.14.3-rt5 real-time patch. Also using x86-64.

There's a known error where the whole system crashes under some load when lazy preempt is enabled. My question is:

How do I disable lazy preempt?


I read to add "NO_PREEMPT_LAZY" to the end of /sys/kernel/debug/sched_features, but when I try to do that (using sudo vim /sys/kernel/debug/sched_features), upon trying to save and exit (:wq) I get the following error:

' "/sys/kernel/debug/sched_features"
"/sys/kernel/debug/sched_features" E667: Fsync failed
WARNING: Original file may be lost or damaged
don't quit the editor until the file is successfully written!
Press ENTER or type command to continue '


If someone could help me get past the vim 'Fsync failed' or disable lazy preempt in another way, I would greatly appraciate it.

Thank you!
 
Old 06-18-2014, 03:11 PM   #2
ophirg
Member
 
Registered: Jan 2008
Location: Israel
Distribution: Kubuntu 13.10
Posts: 134

Rep: Reputation: 34
hi Tdjames

You shouldn't use vim to edit files in the /sys directory. It's a pseudo-filesystem and isn't compatible with text editors.
Use echo instead:
Code:
echo NO_PREEMPT_LAZY > /sys/kernel/debug/sched_features
 
1 members found this post helpful.
Old 06-18-2014, 03:25 PM   #3
Tdjames
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi ophirg,

Thank you for the quick response!

I used the code you wrote, as well as adding sudo in front, but both times I got this:

bash: /sys/kernel/debug/sched_features: Permission denied

How do I get past this permission?

Thank you.
 
Old 06-19-2014, 05:58 AM   #4
ophirg
Member
 
Registered: Jan 2008
Location: Israel
Distribution: Kubuntu 13.10
Posts: 134

Rep: Reputation: 34
hi again

The problem with using sudo is that when you pipe the output to a file (using ">"), you are writing to the file as the original user (not root)

One solution is to use bash as root.
Exit bash right after executing the command. Using bash with root user is very problematic (for security reasons).

Code:
sudo bash
echo NO_PREEMPT_LAZY > /sys/kernel/debug/sched_features
exit
 
1 members found this post helpful.
Old 06-19-2014, 10:00 AM   #5
Tdjames
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
ophirg,

Thank you for the help. Last question though:


When I used those commands I got the error:

bash: echo: write error: Invalid argument

Does this mean that I'm just going in the wrong direction and that using "NO_PREEMPT_LAZY" is not actually the correct way to disable lazy preempt?


Thanks! I really appreciate the help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Preempt RT and Modbus, can I?? webquinty Linux - Software 0 05-14-2009 01:46 PM
linux 2.6.21: Timer Frequency / Preempt draeath Linux - Kernel 1 07-13-2007 03:42 PM
How to disable PREEMPT and/or SMP kernel mode on OpenSuse 10.2 Maladjez Linux - Kernel 3 02-06-2007 01:58 AM
Preemptible Kernel (PREEMPT)---yes or no? ganja_guru Linux - Software 8 09-05-2004 11:29 AM
Slack10 2.4.26 w/ Preempt and ALSA shadyvlad Slackware 1 08-18-2004 01:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration