My Experiences as a Kernel Contributor By Arvind
My Experiences as a Kernel Contributor By Arvind Yadav arvind. Yadav. cs@gmail. com
AGENDA Ø My Experience as a Beginner Ø Snippets about other contributors Ø Every Bit Matters Ø My Contribution Ø Process Guidelines Ø Q&A
MY EXPERIENCES AS A BEGINNER ü How it all started ü How I got my first patch ü Learnings from my failures
MY FIRST PATCH
SNIPPET ABOUT OTHER CONTRIBUTORS § His major contribution deals with Coverty tool generated issues § He has 1000+ patches under his name Gusto A R Silva
SNIPPET ABOUT OTHER CONTRIBUTORS § Her major contribution lies in the area of constify data operations and methods § She has gained 500+ patches under her name Bhumika Goyal
Allen Pais Kees Cook § Both have contributed under ‘Convert timers to use timer_setup() and setup_timer()’ § Allen has contributed over 100+ patches in the current cycle § Kees Cook has been one of the major contributors with 1000+ patches under his name
SNIPPET ABOUT OTHER CONTRIBUTORS Markus Elfring § His major contribution lies in the area of fixing checkpatch error and code cleanup § He has over 1000+ patches under his name
EVERY BIT MATTERS The Typo that destroyed the NASA Rocket Heart Bleed Error AT&T Network Goes Down Day of the dead living
MY CONTRIBUTIONS q CONSTIFY DEVICE ID / ATTRIBUTE q ERROR HANDLING OR TAKING CARE OF RETURN VALUES q MEMORY / CLOCK RELEASES q CODE CLEANUP q COMPILATION WARNING q CHECKPATCH ERROR q BUG FIXING
CONSTIFY DEVICE ID / ATTRIBUTE
ERROR HANDLING OR TAKING CARE OF RETURN VALUES
MEMORY / CLOCK RELEASES
CODE CLEANUP
COMPILATION WARNING
CHECKPATCH ERROR
BUG FIXING kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 1497 Comm: kworker/1: 1 Not tainted 4. 14. 0 -rc 4 -43418 -g 43 a 3 f 84 d 2109 -dirty #380 Hardware name: QEMU Standard PC (i 440 FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: usb_hub_wq hub_event task: ffff 88006 a 5618 c 0 task. stack: ffff 880068 bc 8000 RIP: 0010: imon_probe+0 x 231/0 x 3 f 10 drivers/media/rc/imon. c: 2519 RSP: 0018: ffff 880068 bce 2 d 8 EFLAGS: 00010206 RAX: 00000000 RBX: ffff 8800627 dd 500 RCX: 000000027 RDX: dffffc 00000 RSI: 00000000 RDI: 0000000138 RBP: ffff 880068 bce 5 e 8 R 08: ffff 88006 a 5618 c 0 R 09: ffff 84 b 380 fc R 10: ffff 880068 bce 2 c 8 R 11: 1 ffff 1000 d 4 ac 5 b 3 R 12: ffff 880061830000 R 13: ffff 880061830008 R 14: ffff 883 fa 200 R 15: ffff 883 fa 080 FS: 00000000(0000) GS: ffff 88006 c 500000(0000) knl. GS: 00000000 CS: 0010 DS: 0000 ES: 0000 CR 0: 000080050033 CR 2: 0000206 cbffc CR 3: 000061085000 CR 4: 00000006 e 0 Call Trace: usb_probe_interface+0 x 35 d/0 x 8 e 0 drivers/usb/core/driver. c: 361 really_probe drivers/base/dd. c: 413 driver_probe_device+0 x 610/0 xa 00 drivers/base/dd. c: 557 __device_attach_driver+0 x 230/0 x 290 drivers/base/dd. c: 653 bus_for_each_drv+0 x 161/0 x 210 drivers/base/bus. c: 463 __device_attach+0 x 26 e/0 x 3 d 0 drivers/base/dd. c: 710 device_initial_probe+0 x 1 f/0 x 30 drivers/base/dd. c: 757 bus_probe_device+0 x 1 eb/0 x 290 drivers/base/bus. c: 523 device_add+0 xd 0 b/0 x 1660 drivers/base/core. c: 1835 usb_set_configuration+0 x 104 e/0 x 1870 drivers/usb/core/message. c: 1932 generic_probe+0 x 73/0 xe 0 drivers/usb/core/generic. c: 174 usb_probe_device+0 xaf/0 xe 0 drivers/usb/core/driver. c: 266 really_probe drivers/base/dd. c: 413 driver_probe_device+0 x 610/0 xa 00 drivers/base/dd. c: 557 __device_attach_driver+0 x 230/0 x 290 drivers/base/dd. c: 653 bus_for_each_drv+0 x 161/0 x 210 drivers/base/bus. c: 463 __device_attach+0 x 26 e/0 x 3 d 0 drivers/base/dd. c: 710 device_initial_probe+0 x 1 f/0 x 30 drivers/base/dd. c: 757 bus_probe_device+0 x 1 eb/0 x 290 drivers/base/bus. c: 523 device_add+0 xd 0 b/0 x 1660 drivers/base/core. c: 1835 usb_new_device+0 x 7 b 8/0 x 1020 drivers/usb/core/hub. c: 2457 hub_port_connect drivers/usb/core/hub. c: 4903 hub_port_connect_change drivers/usb/core/hub. c: 5009 port_event drivers/usb/core/hub. c: 5115 hub_event+0 x 194 d/0 x 3740 drivers/usb/core/hub. c: 5195 process_one_work+0 xc 7 f/0 x 1 db 0 kernel/workqueue. c: 2119 worker_thread+0 x 221/0 x 1850 kernel/workqueue. c: 2253 kthread+0 x 3 a 1/0 x 470 kernel/kthread. c: 231 ret_from_fork+0 x 2 a/0 x 40 arch/x 86/entry_64. S: 431 Code: ff e 8 a 4 81 cb 01 31 f 6 48 89 df e 8 2 a cc 65 ff 0 f ae f 0 48 8 d
BUG FIXING Contd INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 24 Comm: kworker/0: 1 Not tainted 4. 14. 0 -rc 1 -42251 -gebb 2 c 2437 d 80 #215 Hardware name: QEMU Standard PC (i 440 FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack. c: 16 dump_stack+0 x 292/0 x 395 lib/dump_stack. c: 52 register_lock_class+0 x 6 c 4/0 x 1 a 00 kernel/locking/lockdep. c: 769 __lock_acquire+0 x 27 e/0 x 4550 kernel/locking/lockdep. c: 3385 lock_acquire+0 x 259/0 x 620 kernel/locking/lockdep. c: 4002 flush_work+0 xf 0/0 x 8 c 0 kernel/workqueue. c: 2886 hdpvr_probe+0 x 233/0 x 20 d 0 drivers/media/usb/hdpvr-core. c: 400 usb_probe_interface+0 x 35 d/0 x 8 e 0 drivers/usb/core/driver. c: 361 really_probe drivers/base/dd. c: 413 driver_probe_device+0 x 610/0 xa 00 drivers/base/dd. c: 557 __device_attach_driver+0 x 230/0 x 290 drivers/base/dd. c: 653 bus_for_each_drv+0 x 161/0 x 210 drivers/base/bus. c: 463 __device_attach+0 x 26 e/0 x 3 d 0 drivers/base/dd. c: 710 device_initial_probe+0 x 1 f/0 x 30 drivers/base/dd. c: 757 bus_probe_device+0 x 1 eb/0 x 290 drivers/base/bus. c: 523 device_add+0 xd 0 b/0 x 1660 drivers/base/core. c: 1835 usb_set_configuration+0 x 104 e/0 x 1870 drivers/usb/core/message. c: 1932 generic_probe+0 x 73/0 xe 0 drivers/usb/core/generic. c: 174 usb_probe_device+0 xaf/0 xe 0 drivers/usb/core/driver. c: 266 really_probe drivers/base/dd. c: 413 driver_probe_device+0 x 610/0 xa 00 drivers/base/dd. c: 557 __device_attach_driver+0 x 230/0 x 290 drivers/base/dd. c: 653 bus_for_each_drv+0 x 161/0 x 210 drivers/base/bus. c: 463 __device_attach+0 x 26 e/0 x 3 d 0 drivers/base/dd. c: 710 device_initial_probe+0 x 1 f/0 x 30 drivers/base/dd. c: 757 bus_probe_device+0 x 1 eb/0 x 290 drivers/base/bus. c: 523 device_add+0 xd 0 b/0 x 1660 drivers/base/core. c: 1835 usb_new_device+0 x 7 b 8/0 x 1020 drivers/usb/core/hub. c: 2457 hub_port_connect drivers/usb/core/hub. c: 4903 hub_port_connect_change drivers/usb/core/hub. c: 5009 port_event drivers/usb/core/hub. c: 5115 hub_event+0 x 194 d/0 x 3740 drivers/usb/core/hub. c: 5195 process_one_work+0 xc 7 f/0 x 1 db 0 kernel/workqueue. c: 2119 worker_thread+0 x 221/0 x 1850 kernel/workqueue. c: 2253 kthread+0 x 3 a 1/0 x 470 kernel/kthread. c: 231 ret_from_fork+0 x 2 a/0 x 40 arch/x 86/entry_64. S: 431
PROCESS GUIDELINES ØLearn GIT ØLearn ‘how to build’ a module/kernel ØRead the following documents several times üDocuments/How. To üDocuments/Coding. Style ØUse check. Patch. pl and get. Maintainer. pl ØSubject and Description should align the proper domain/ subsystem
Q&A
THANK YOU !!
- Slides: 21