LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-19-2022, 09:57 PM   #1
watchintv
Member
 
Registered: Oct 2016
Posts: 57

Rep: Reputation: Disabled
Does Linux 5.x use segmentation or paging, or both?


I am unsure whether Linux 5.x uses segmentation or paging, or both in regards to memory?
 
Old 09-19-2022, 10:20 PM   #2
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Wonder if this is interesting? https://chrisdown.name/2018/01/02/in...e-of-swap.html
 
Old 11-07-2022, 06:33 AM   #3
IsaccBarker
LQ Newbie
 
Registered: Nov 2022
Location: Generalized in equations, without escape!
Distribution: Arch
Posts: 14

Rep: Reputation: 0
The x86-64 architecture does not use segmentation in long mode (64-bit mode). When you see "Segmentation Fault 11" or whatnot if you are developing userspace C(++) code, it's referring to paging.

If you want to get --pedantic, it's still possible in long mode with some trickery to get them to kind of work.

According to a Unix Stack Exchange answer,

Quote:
An example is thread-local data, one of the normally unused segment registers [that] points to thread-local data. But that is mainly to avoid reserving one of the general purpose registers for this task.
So, in your everyday life, you can probably just forget about segmentation in the Linux kernel.
 
Old 11-07-2022, 04:56 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
Linux uses paging but misnames it as swapping. The original method of extended memory circa 1970 was done only with software and was called swapping. Then a better method which uses both hardware and software functions was developed and called paging. During the time that both swapping and paging existed the open source movement developed a paging method and misnamed it swapping. Linux misnames its paging partition as a swapping partition.

Handling segmentation and page faults are part of the paging algorithm and are handled by a combination of kernel code and hardware.
 
  


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
Paging and Segmentation rasy Linux - Security 2 04-25-2015 10:25 PM
[SOLVED] Samba config can read both directions but not write both directions lhiggie Linux - Enterprise 2 05-14-2013 12:33 PM
[SOLVED] Paging and Segmentation: Virtual Memory Linux josecolella Linux - General 1 11-03-2011 12:49 PM
`sar -B` - does paging stats include file cache or literally physical disk? zQUEz Linux - Server 3 06-04-2009 06:04 PM
Does Fedora use Paging? ttfootball60 Linux - Distributions 2 10-23-2006 08:37 AM

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

All times are GMT -5. The time now is 10:15 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