kprobe is a useful tool when debug kernel.
It can directly hook the related function of kernel,
before or after it run.
It also can be used to patch kernel in some special case.
In version management, we often meet this case:
1 | When a line/file is deleted for git repo? |
In this case, we need git bisect
.
git bisect start
git bisect good commit_id1
git bisect bad commit_id2
git bisect bad/good
repeat to step 4, until finish.
more auto method for step4 is run with git bisect run command
.
by the way git blame
is used to check the added line/file.
yes. but it is very different with IPv4.
It should be ‘clone’ strictly speaking.
For simple let us only focus on ip6_pol_route
, and variable struct rt6_info *nrt
.
When a route is matched, a nrt
will be created by rt6_alloc_cow
or rt6_alloc_clone
.
the nrt
will be set with flag RTF_CACHE;
ip6_ins_rt
insert the new nrt
to fib tree.
kernel starts fib6 gc for nrt
.
so there will be a new cache
route, and after a period it will disappear.
##summary
IP4 route register a call back notify in IPv4 address.
When a address is added, fib_inetaddr_event
will be called.
and then 4 route entry maybe added in fib_add_ifaddr
unregister_netdev
is used to delete a net device. In fact, it equals:
1 | rtnl_lock(); |
a temporary list stores a single net device, which is to be deleted.net_todo_list
stores all the net devices are being deleted.
The core function is rollback_registered_many
, which efficiently deletes many devices in a list.
But here, in this case, one a single netdevice in the list.
##summary
There is a struct rt_rq
in struct rq
. struct rt_rq
is used to store all
the realtime task in current struct rq
. which has a struct rt_prio_array active
.
There are four sched_class
,stop_sched_class --> rt_sched_class --> fair_sched_class --> idle_sched_class
They are linked one by one staticly by struct sched_class->next
by their defination.
Each sched_class
has method pick_next_task
, which is used to select
a perfect process to run from each sched_class
‘s runqueue.
When we need schedule, the four pick_next_task
will be called one by one.
As a optimization, most time there is no rt task in running state,
in this case we can directly call fair_sched_class
.
##summary:
*_rq
of rq? 1 | 426 struct cfs_rq cfs; |