Some idea about creating a linux kernel patch using Git

ABOUT creating a linux kernel patch using Git
[bash]
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Initialized empty Git repository in /home/jeffrin/linux-2.6/.git/
remote: Counting objects: 1806930, done.
remote: Compressing objects: 100% (278260/278260), done.
Receiving objects: 14% (2553100/1806930), 117.83 MiB | 127 KiB/s
Resolving deltas: 100% (1513210/1513210), done.

$cd linux-2.6
$./scripts/ge
genksyms/ get_maintainer.pl

$./scripts/get_maintainer.pl –file sound/ac97_bus.c
Jaroslav Kysela <perex@perex.cz>
Takashi Iwai <tiwai@suse.de>
alsa-devel@alsa-project.org
linux-kernel@vger.kernel.org
$

[/bash]

[bash]

$ git status
# On branch master
nothing to commit (working directory clean)
$ git branch jeffrin
$ git branch
jeffrin
* master
$ git checkout jeffrin
Switched to branch ‘jeffrin’
$
$git status
# On branch jeffrin
nothing to commit (working directory clean)
$
$./scripts/checkpatch.pl
checkpatch.pl: no input files
$./scripts/checkpatch.pl –file –terse sound/ac97_bus.c
sound/ac97_bus.c:22: WARNING: line over 80 characters
sound/ac97_bus.c:75: WARNING: EXPORT_SYMBOL(foo); should immediately
follow its function/variable
total: 0 errors, 2 warnings, 77 lines checked
[/bash]
[bash]
$vim sound/ac97_bus.c +22
$./scripts/checkpatch.pl –file –terse sound/ac97_bus.c
sound/ac97_bus.c:22: ERROR: trailing whitespace
sound/ac97_bus.c:75: WARNING: EXPORT_SYMBOL(foo); should immediately
follow its function/variable
total: 1 errors, 1 warnings, 77 lines checked
$vim sound/ac97_bus.c +22
$./scripts/checkpatch.pl –file –terse sound/ac97_bus.c
sound/ac97_bus.c:75: WARNING: EXPORT_SYMBOL(foo); should immediately
follow its function/variable
total: 0 errors, 1 warnings, 77 lines checked
$vim sound/ac97_bus.c +75
[/bash]
[bash]
$git status
# On branch jeffrin
# Changed but not updated:
# (use "git add …" to update what will be committed)
# (use "git checkout — …" to discard changes in working directory)
#
# modified: sound/ac97_bus.c
#
no changes added to commit (use "git add" and/or "git commit -a")
$git diff
diff –git a/sound/ac97_bus.c b/sound/ac97_bus.c
index a351dd0..c93251a 100644
— a/sound/ac97_bus.c
+++ b/sound/ac97_bus.c
@@ -19,9 +19,9 @@

/*
* Let drivers decide whether they want to support given codec from their
– * probe method. Drivers have direct access to the struct snd_ac97 structure and may
– * decide based on the id field amongst other things.
– */
+ * probe method. Drivers have direct access to the struct snd_ac97
+ * structure and may decide based on the id field amongst other things.
+*/
static int ac97_bus_match(struct device *dev, struct device_driver *drv)
{
return 1;
$
[/bash]

[bash]

$git commit sound/ac97_bus.c
[jeffrin a2c2867] sound: Fixed line limit issue in sound/ac97_bus.c
This is a patch to the sound/ac97_bus.c file that fixes up a 80
character line limit issue found by the checkpatch.pl tool.
Signed-off-by: Jeffrin Jose
1 files changed, 3 insertions(+), 3 deletions(-)
$git show HEAD
commit a2c2867876c246420a199a0fb4c36ad29100a42cc
Author: Jeffrin Jose
Date: Mon Dec 6 19:27:53 2010 +0530

sound: Fixed line limit issue in sound/ac97_bus.c
This is a patch to the sound/ac97_bus.c file that fixes up a 80 character
line limit issue found by the checkpatch.pl tool.
Signed-off-by: Jeffrin Jose

diff –git a/sound/ac97_bus.c b/sound/ac97_bus.c
index a351dd0..c93251a 100644
— a/sound/ac97_bus.c
+++ b/sound/ac97_bus.c
@@ -19,9 +19,9 @@

/*
* Let drivers decide whether they want to support given codec from their
– * probe method. Drivers have direct access to the struct snd_ac97 structure and may
– * decide based on the id field amongst other things.
– */
+ * probe method. Drivers have direct access to the struct snd_ac97
+ * structure and may decide based on the id field amongst other things.
+*/
static int ac97_bus_match(struct device *dev, struct device_driver *drv)
{
return 1;
[/bash]
[bash]
$git format-patch master..jeffrin
0001-sound-Fixed-line-limit-issue-in-sound-ac97_bus.c.patch
[/bash]
[bash]
$./scripts/checkpatch.pl 0001-sound-Fixed-line-limit-issue-in-sound-ac97_bus.c.patch
total: 0 errors, 0 warnings, 12 lines checked

0001-sound-Fixed-line-limit-issue-in-sound-ac97_bus.c.patch has no obvious style
problems and is ready for submission.
$
[/bash]

Unevictable: 4 kB 0.1

Unevictable:           4 kB
The Unevictable LRU infrastructure addresses the following classes of
unevictable pages:

+ page owned by ram disks or ramfs
+ page mapped into SHM_LOCKed shared memory regions
+ page mapped into VM_LOCKED [mlock()ed] vmas
Least  Recently Used  (LRU): discards  the least  recently  used items
first. This  algorithm requires keeping  track of what was  used when,
which  is expensive if  one wants  to make  sure the  algorithm always
discards the least recently used item. General implementations of this
technique require  to keep  "age bits" for  cache-lines and  track the
"Least  Recently   Used"  cache-line   based  on  age-bits.   In  such
implementation, every time a cache-line  is used, the age of all other
cache-lines changes.  LRU is actually  a family of  caching algorithms
with members including:  2Q by Theodore Johnson and  Dennis Shasha and
LRU/K by Pat O'Neil, Betty O'Neil and Gerhard Weikum.

Hugetlb pages are also  unevictable. Hugepages are already implemented
in a way  that these pages don't  reside on the LRU and  hence are not
iterated over during  the vmscan.  So there is no  need to move around
these pages  across different  LRU's. We just  account these  pages as
unevictable for correct statistics.


The Unevictable LRU  adds an additional LRU list  to track unevictable
pages and to hide these pages from vmscan.  This mechanism is based on
a patch  by Larry  Woodman of Red  Hat to address  several scalability
problems with page reclaim in  Linux.  The problems have been observed
at  customer sites  on large  memory x86_64  systems.  For  example, a
non-numal x86_64 platform with 128GB  of main memory will have over 32
million 4k  pages in a  single zone.  When  a large fraction  of these
pages are not evictable for  any reason [see below], vmscan will spend
a lot of time scanning the LRU lists looking for the small fraction of
pages that  are evictable.  This can  result in a  situation where all
cpus are  spending 100% of their time  in vmscan for hours  or days on
end, with the system completely unresponsive.

kern.log part 1



$cut -d ' ' -f6-20 /var/log/kern.log
[22293.016178] kjournald starting. Commit interval 5 seconds
[22293.016218] EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
[22293.016635] EXT3 FS on sdb2, internal journal
[22293.016647] EXT3-fs: mounted filesystem with ordered data mode.
$

The First field shown above is a timestamp.
The kernel ring buffer is not really a log file per se,
but rather an area in the running kernel you can
query for kernel bootup messages via the dmesg utility

Reference/Source :
https://help.ubuntu.com/community/LinuxLogFiles

Related Reading :
http://www.linuxjournal.com/article/6060

About RTO retransmission and tcp_orphan_retries

About RTO retransmission and tcp_orphan_retries

tcp_orphan_retries - INTEGER
This value influences the timeout of a locally closed TCP connection,when RTO retransmissions remain
unacknowledged.

source :
Linux Kernel Documentation . 2.6.32

TYPICAL SHELL ON PROC FILESYSTEM
[bash]
$cat /proc/sys/net/ipv4/tcp_orphan_retries
0
$
[/bash]

TYPICAL SOURCE CODE RELATED
[c]
net/ipv4/tcp_timer.c – 39 identical
99: static int tcp_orphan_retries(struct sock *sk, int alive)
100: {
101: int retries = sysctl_tcp_orphan_retries; /* May be zero. */
157: retry_until = tcp_orphan_retries(sk, alive);
158:
android.git.kernel.org/kernel/msm.git – GPL – C – More from msm.git »
[/c]

[bash]
shaper.queues
176: echo "Set number of orphant retries to 5"
177: echo 5 &gt; /proc/sys/net/ipv4/tcp_orphan_retries
178:
http://www.chronox.de/tc+filter/shaper-0.2.tar.bz2 – Unknown – Shell – More from shaper-0.2.tar.bz2 »
[/bash]
[text]
usr/share/man/man7/tcp.7
282: .TP
283: .B tcp_orphan_retries
284: The maximum number of attempts made to probe the other
www2.cddc.vt.edu/linux/distributions/7linux/7v6/7base/7v6a11.tar.bz2 – Unknown – Troff –
[/text]
TYPICAL EXPLANATION RELATED

The  tcp_orphan_retries variable  tells the  TCP/IP stack how many times to retry  to kill connections on
the other side before killing  it on our own side.  If your machine runs  as a  highly loaded  http
server it  may be  worth thinking  about lowering  this value.  http  sockets will consume large amounts of resources if not checked

This variable  takes an integer value.The default value for this variable is 7, which  would approximately correspond to 50 seconds  through 16 minutes depending on the Retransmission Timeout (RTO).


source :
Ipsysctl tutorial 1.0.4
Oskar Andreasson
blueflux@koffein.net
Copyright © 2002 by Oskar Andreasson