{"id":79099,"date":"2026-11-17T02:03:48","date_gmt":"2026-11-17T02:03:48","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=79099"},"modified":"2026-11-17T02:03:48","modified_gmt":"2026-11-17T02:03:48","slug":"linux-advanced-2-05-kernel","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=79099","title":{"rendered":"Linux Advanced 2 05 \u2014 Kernel Modules and Resource Limits"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1993\">Linux Advanced 2 category<\/a> \u00b7 Lesson 5 of 7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AI disclosure<\/strong> \u2014 AI-generated content, posted as is. AI can make mistakes. This extension adds new material and links related posts from this site. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning goal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Read kernel module information and identify the current process\u2019s resource-control group without changing the kernel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Concepts and setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The site&#8217;s kernel and device-driver posts point to low-level Linux internals. This operational lab gives you a read-only way to inspect them. Modules are loadable kernel code. Built-in drivers may not appear in lsmod, and loading a module is not required just to learn its metadata. Control groups organize processes into resource-accounting and control hierarchies. Namespaces provide isolated views. These are different mechanisms and both can be involved in running containers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Inspect the kernel and a module record<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>uname -r\nlsmod | head -n 6\n# If loop is present as a module or discoverable as built-in:\nmodinfo -F filename loop\njournalctl -k -b -n 5 --no-pager<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>6.x.x-example\nModule                  Size  Used by\nloop                   45056  0\n...\n\/lib\/modules\/6.x.x-example\/kernel\/drivers\/block\/loop.ko.zst\n... kernel: ...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your actual kernel and modules differ. The loop driver can be built in or absent, and logs can require authorized access. Do not load or remove modules merely to make the output match.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Find the current cgroup and inspect a limit where supported<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &quot;\/proc\/$$\/cgroup&quot;\nstat -fc '%T' \/sys\/fs\/cgroup\ngroup=$(awk -F: '$1==&quot;0&quot; &amp;&amp; $2==&quot;&quot; {print $3}' &quot;\/proc\/$$\/cgroup&quot;)\nif test -n &quot;$group&quot; &amp;&amp; test -r &quot;\/sys\/fs\/cgroup$group\/memory.max&quot;; then\n  cat &quot;\/sys\/fs\/cgroup$group\/memory.max&quot;\nfi<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0::\/user.slice\/user-1000.slice\/session-2.scope\ncgroup2fs\nmax<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This example uses the unified cgroup v2 hierarchy. Containers can change the cgroup view and filesystem layout. The word max means no numeric limit at this level, not necessarily no limit at any ancestor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Questions only<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Does absence from lsmod prove that Linux has no such driver?<\/li>\n\n\n<li>What is the difference between a cgroup and a namespace?<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Which read-only command identifies the running kernel release?<\/li>\n\n\n<li>In cgroup v2, why can a process hit a memory limit even if its memory.max says max?<\/li>\n\n\n<li>How would you collect kernel evidence without reloading a driver?<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Questions and answers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check answers<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>Does absence from lsmod prove that Linux has no such driver?<\/strong><br><strong>Answer<\/strong> \u2014 No. It can be built into the kernel or otherwise not listed as a loaded module.<\/li>\n\n\n<li><strong>What is the difference between a cgroup and a namespace?<\/strong><br><strong>Answer<\/strong> \u2014 A cgroup groups processes for accounting and resource controls. A namespace isolates a view of a system resource.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment answer key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>Which read-only command identifies the running kernel release?<\/strong><br><strong>Answer<\/strong> \u2014 uname -r.<\/li>\n\n\n<li><strong>In cgroup v2, why can a process hit a memory limit even if its memory.max says max?<\/strong><br><strong>Answer<\/strong> \u2014 A parent cgroup may enforce a narrower quota.<\/li>\n\n\n<li><strong>How would you collect kernel evidence without reloading a driver?<\/strong><br><strong>Answer<\/strong> \u2014 Use boot kernel logs, lsmod and modinfo where available, and record the actual running kernel and timestamps.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Related source articles on this site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=70249\">Linux Kernel Programming : A Complete Course #1 #RHCSA<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=68598\">How to write device drivers in c in Linux #72<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=76443\">Linux: Disk Space, Memory Space, Running Processes<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78691\">Q &amp; A:  Linux: Switch Users, Boot Process, File System<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Technical references<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/docs.kernel.org\/admin-guide\/cgroup-v2.html\">Linux kernel cgroup v2 guide<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Continue the course<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previous lesson 04 \u2014 Performance Triage with vmstat and PSI. Next lesson 06 \u2014 Encrypted Backups and Restore Drills.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1993\">Linux Advanced 2 category<\/a> \u00b7 Lesson 5 of 7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Read kernel module information and identify the current process\u2019s resource-control group without changing the kernel.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1993],"tags":[],"class_list":["post-79099","post","type-post","status-publish","format-standard","hentry","category-linux-advanced-2","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":79102,"url":"http:\/\/bangla.sitestree.com\/?p=79102","url_meta":{"origin":79099,"position":0},"title":"Linux Administration Course \u2014 Start Here and Lesson Index","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"A 33-lesson Linux course from shell fundamentals to server administration, performance, and a recovery capstone.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79069,"url":"http:\/\/bangla.sitestree.com\/?p=79069","url_meta":{"origin":79099,"position":1},"title":"Linux Basics 01 \u2014 Linux, the Shell, and Your First Lab","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Tell the kernel, distribution, terminal, and shell apart, then identify the system you are actually using.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79098,"url":"http:\/\/bangla.sitestree.com\/?p=79098","url_meta":{"origin":79099,"position":2},"title":"Linux Advanced 2 04 \u2014 Performance Triage with vmstat and PSI","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Use related signals to decide whether to investigate CPU, memory, disk I\/O, or an application bottleneck.","rel":"","context":"In &quot;Linux Advanced 2&quot;","block_context":{"text":"Linux Advanced 2","link":"http:\/\/bangla.sitestree.com\/?cat=1993"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78653,"url":"http:\/\/bangla.sitestree.com\/?p=78653","url_meta":{"origin":79099,"position":3},"title":"20 mixed quiz questions Intro to Linux","author":"Sayed","date":"May 20, 2026","format":false,"excerpt":"Below are 20 mixed quiz questions Intro to Linux. They include TF, MCQ, Multi-select, Matching, Ordering, Fill in the Blank, and Short Answer questions, with concept, hands-on, analytical, and higher-order learning coverage. Quiz: Introduction to Linux 1. True\/False Linux is only used on desktop computers. Answer: FalseExplanation: Linux is used\u2026","rel":"","context":"In &quot;Anything Linux&quot;","block_context":{"text":"Anything Linux","link":"http:\/\/bangla.sitestree.com\/?cat=1976"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70249,"url":"http:\/\/bangla.sitestree.com\/?p=70249","url_meta":{"origin":79099,"position":4},"title":"Linux Kernel Programming : A Complete Course #1 #RHCSA","author":"Author-Check- Article-or-Video","date":"August 30, 2021","format":false,"excerpt":"Linux Kernel Programming From: http:\/\/sitestree.com\/?p=4906 Categories:1, RHCSATags: Post Data:2011-04-05 00:30:24 Shop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a> (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a> In Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a> <a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a> 8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a> Shop Online:\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79083,"url":"http:\/\/bangla.sitestree.com\/?p=79083","url_meta":{"origin":79099,"position":5},"title":"Linux Intermediate 07 \u2014 IP Addresses, Routes, and Name Resolution","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Separate the problems of link state, addressing, routing, name resolution, and listening services.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79099"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79099\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79099"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}