LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 04-14-2023, 07:04 PM   #1
QuanAiGPT
LQ Newbie
 
Registered: Apr 2023
Posts: 3

Rep: Reputation: 0
What does Open File Description Lock do


Hi all, I'm creating some applications using OFD lock to do IPC. However I do want to know what the kernel does behind my operations.

For example, when I acquired an OFD lock, what does the kernel do? Is the locking done in user space / kernel space / via I/O file system? Where's the lock structure resides in, is it in open file description table?
 
Old 04-15-2023, 06:16 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
You might want to start here: https://www.gnu.org/software/libc/ma...ion-Locks.html
 
Old 04-15-2023, 06:57 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
My initial reaction to these sort of things is always:
- why do you care ?.
- why haven't you checked the (kernel) source tree ?.
 
Old 04-17-2023, 11:58 AM   #4
QuanAiGPT
LQ Newbie
 
Registered: Apr 2023
Posts: 3

Original Poster
Rep: Reputation: 0
I care because I care performance... OFD suits my application well. I've done experiments to show it's good. However, I just wanted to know what's happening in the background to get clear about what my application is doing.

Really appreciated if there is any idea / advice to the question.
 
Old 04-17-2023, 02:20 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
Did you read the link I posted?
 
Old 04-17-2023, 03:02 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
If you’re ready to “care [about] performance” at this level, then you’re ready to look at the kernel source yourself instead of asking us to do it for you.

Last edited by dugan; 04-17-2023 at 05:04 PM.
 
Old 04-18-2023, 03:24 PM   #7
QuanAiGPT
LQ Newbie
 
Registered: Apr 2023
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
Did you read the link I posted?
Sure. I wrote my whole program by referring to that but I need more detail behind program itself. I guess I'll need to look into kernel codes.
 
Old 04-18-2023, 05:42 PM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
In my humble opinion, such concerns are both technically irrelevant and unnecessary. Linux is "the environment." If you have established to your satisfaction that "performance is 'good' when this strategy is used," then you are done. You should simply treat the kernel as "a black box." As long as it works and "performance is good [enough]," then you don't have to be concerned with "how it was implemented (in any particular case)."

"How does the kernel actually work? Well, there are these magical little elves who live in a tree ... and one of them is named Linus ..."

Last edited by sundialsvcs; 04-18-2023 at 05:46 PM.
 
Old 04-19-2023, 12:16 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
Do you have a problem somewhere? Do you want to solve something? Or do you want to inspect the source code of kernel (to understand OFD)? What is your goal?
 
  


Reply



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
[SOLVED] Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) Ztcoracat Debian 5 02-23-2019 10:02 AM
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) Grimm666 Linux - Newbie 3 07-16-2015 02:16 AM
open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied gabsik Linux - Server 6 08-30-2012 09:39 PM
deian yum lock [ ERR] Reading state information E: Could not get lock /var/lock/aptit jayakumar01 Linux - Server 1 12-05-2011 11:26 AM
Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied) basina Linux - Laptop and Netbook 3 09-05-2011 05:18 PM

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

All times are GMT -5. The time now is 11:49 PM.

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