LinuxQuestions.org
Help answer threads with 0 replies.
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-03-2008, 04:28 AM   #1
heroma
LQ Newbie
 
Registered: Jun 2008
Posts: 20

Rep: Reputation: 0
Big kernel lock in 2.6.10 and scheduling


Hi everybody,I have some questions in scheduling and locking the kernel (Big Kernel Lock) in kernel 2.6.10:
1. Is it posible that one process invoke lock_kernel() for more than onc? In other word can lock_depth have positive value means more than zero?

2. If process A catch the lock of kernel (with invoking lock_kernel()) and after it’s timestamp scheduler release kernel lock from process A with(release_kernel_lock(prev) in kernel_lock.c) and scheduler give the lock to process B, what happen for the data structures of the kernel that process A change them and process A need them again? Can B manipulates them? After that process A reacquire kernel lock from where continue it’s executing?

3. How can a process reacquire big kernel lock?


4. From where scheduler know that one process (not current) need kernel lock while it’s lock_depth=-1 before invoking lock_depth?
Best regards.
 
Old 06-03-2008, 05:36 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Of course you can call lock twice; it simply deadlocks the kernel.

Why do you want to use the BKL? Do you want to be flamed by the LKML? The BKL was an early mistake which many people wish would go away, but no one has time to spare to fix the remaining legacy code which uses the BKL.
 
Old 06-03-2008, 07:45 AM   #3
heroma
LQ Newbie
 
Registered: Jun 2008
Posts: 20

Original Poster
Rep: Reputation: 0
I don't use it! only, I want to know it.
 
Old 07-02-2008, 07:04 AM   #4
heroma
LQ Newbie
 
Registered: Jun 2008
Posts: 20

Original Poster
Rep: Reputation: 0
Hi,
Can anybody tell me that when scheduler will release kernel lock provisionally from process that has the BKL?"with release_kernel_lock()" . if BKL releases provisionally what will happen for datas of previous process?
thanks
 
Old 07-03-2008, 06:49 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
It is categorically true of any locking mechanism that you:
  1. Must "acquire" the lock before making any examination whatsoever of the data structure.
  2. Must leave the data struture in a logically-complete and stable state before unlocking it.
  3. Must spend the minimum amount of time possible with the lock held ... you cannot yield-control.
  4. After acquiring the lock again, you must start over completely from-scratch. Nothing that you might have "remembered" is valid.
The "Big Kernel Lock" idea is a poor one at-its-core: locks ought not to be "big." Nevertheless, it's easy to see how the lock came to be. "Big locks" are convenient when you are introducing them into logic that never had, nor needed, locks before... as the kernel itself didn't. But then they're quite difficult to get rid of.
 
Old 07-04-2008, 01:11 AM   #6
heroma
LQ Newbie
 
Registered: Jun 2008
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sundialsvcs View Post
[*] After acquiring the lock again, you must start over completely from-scratch. Nothing that you might have "remembered" is valid.[/list]


what would you mean?
do you mean that After acquiring the lock again, you must start from the beginning?
thanks
 
  


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
Big kernel lock in 2.6.10 heroma Programming 3 06-05-2008 12:17 PM
LXer: Removing the Big Kernel Lock LXer Syndicated Linux News 0 05-16-2008 11:50 AM
Hard lock plus Caps and Scroll Lock flashing (kernel panic?) TiredOfThis Linux - General 4 12-11-2007 07:35 PM
How do I change scheduling priorities? (2.6 kernel) prcarp Programming 3 04-19-2006 03:24 AM
Kernel Scheduling netkern Linux - General 1 04-14-2001 04:18 PM

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

All times are GMT -5. The time now is 08:54 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
Open Source Consulting | Domain Registration