{"action":"created","issue":{"url":"https://api.github.com/repos/cyring/CoreFreq/issues/2","labels_url":"https://api.github.com/repos/cyring/CoreFreq/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/cyring/CoreFreq/issues/2/comments","events_url":"https://api.github.com/repos/cyring/CoreFreq/issues/2/events","html_url":"https://github.com/cyring/CoreFreq/issues/2","id":92495183,"number":2,"title":"Paging bug","user":{"login":"cyring","id":11563789,"avatar_url":"https://avatars.githubusercontent.com/u/11563789?v=3","gravatar_id":"","url":"https://api.github.com/users/cyring","html_url":"https://github.com/cyring","followers_url":"https://api.github.com/users/cyring/followers","following_url":"https://api.github.com/users/cyring/following{/other_user}","gists_url":"https://api.github.com/users/cyring/gists{/gist_id}","starred_url":"https://api.github.com/users/cyring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyring/subscriptions","organizations_url":"https://api.github.com/users/cyring/orgs","repos_url":"https://api.github.com/users/cyring/repos","events_url":"https://api.github.com/users/cyring/events{/privacy}","received_events_url":"https://api.github.com/users/cyring/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cyring/CoreFreq/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/cyring/CoreFreq/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-01T22:04:28Z","updated_at":"2015-07-13T16:19:45Z","closed_at":"2015-07-13T16:19:45Z","body":"Below is a bug about \"paging\"\r\n\r\nIntro.\r\nSecond times I read it and the answer remains in Chapter 15. Memory Mapping and DMA\r\nDMA @ http://www.makelinux.net/ldd3/chp-15\r\n\r\nHow did I manage to make it work with ```remap_vmalloc_range()``` ?\r\nI don't remember, perhaps in kernel source code.\r\nBut I mostly sure that ```remap_vmalloc_range()``` requires additional treatment to handle several & consecutive pages.\r\n\r\nI will also try the ```remap_pfn_range()``` way\r\n\r\nRecently I was thinking if I could dedicate one memory page per cpu , whatever the page address & allocation kind are.\r\nI mean : a page-cpu-cache L1 affinity running  in a dedicated kthread. \r\nWhy ? Because each cpu has its own set of msr counters registers. This algorithm  should not meet a race condition.\r\n\r\n--- BUG BEGIN ---\r\njuil. 01 07:56:39 RAM kernel: BUG: unable to handle kernel paging request at 0000000001c000eb\r\njuil. 01 07:56:39 RAM kernel: IP: [<ffffffffa000c185>] IntelFreq_init+0x185/0x1000 [intelfreq]\r\njuil. 01 07:56:39 RAM kernel: PGD 2f79b9067 PUD 2f79ba067 PMD 0 \r\njuil. 01 07:56:39 RAM kernel: Oops: 0002 [#1] PREEMPT SMP \r\njuil. 01 07:56:39 RAM kernel: Modules linked in: intelfreq(O+) cfg80211 rfkill snd_hda_codec_hdmi snd_hda_codec_analog snd_hda_codec_generic mousedev nvidia(PO) snd_hda_intel snd_hda_controller iTCO_wdt evdev iTCO_vendor_support mac_hid mxm_wmi snd_hda_codec snd_hwdep snd_pcm snd_timer snd psmouse r8169 soundcore se\r\njuil. 01 07:56:39 RAM kernel:  usbcore usb_common i8042 serio\r\njuil. 01 07:56:39 RAM kernel: CPU: 6 PID: 1817 Comm: insmod Tainted: P          IO    4.0.6-1-ARCH #1\r\njuil. 01 07:56:39 RAM kernel: Hardware name: System manufacturer System Product Name/Rampage II GENE, BIOS 1701    09/19/2011\r\njuil. 01 07:56:39 RAM kernel: task: ffff88031512bcc0 ti: ffff8802f20f8000 task.ti: ffff8802f20f8000\r\njuil. 01 07:56:39 RAM kernel: RIP: 0010:[<ffffffffa000c185>]  [<ffffffffa000c185>] IntelFreq_init+0x185/0x1000 [intelfreq]\r\njuil. 01 07:56:39 RAM kernel: RSP: 0018:ffff8802f20fbbe8  EFLAGS: 00010246\r\njuil. 01 07:56:39 RAM kernel: RAX: 0000000000000008 RBX: 0000000001c0003f RCX: 000000000000003f\r\njuil. 01 07:56:39 RAM kernel: RDX: 0000000000000000 RSI: ffff8802f20fbbe8 RDI: ffffffff818c7f70\r\njuil. 01 07:56:39 RAM kernel: RBP: ffff8802f20fbca8 R08: ffffffff818c7f90 R09: ffffea000c9ce800\r\njuil. 01 07:56:39 RAM kernel: R10: ffffffff812c3640 R11: 0000000000000000 R12: ffff8802f8835e00\r\njuil. 01 07:56:39 RAM kernel: R13: 0000000000000000 R14: ffffffffa000c000 R15: 0000000000000001\r\njuil. 01 07:56:39 RAM kernel: FS:  00007f4176686700(0000) GS:ffff88033fcc0000(0000) knlGS:0000000000000000\r\njuil. 01 07:56:39 RAM kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b\r\njuil. 01 07:56:39 RAM kernel: CR2: 0000000001c000eb CR3: 00000002f8957000 CR4: 00000000000007e0\r\njuil. 01 07:56:39 RAM kernel: Stack:\r\njuil. 01 07:56:39 RAM kernel:  49656e69756e6547 000000006c65746e 05100800000106a4 bfebfbff0098e3bd\r\njuil. 01 07:56:39 RAM kernel:  0000004000000040 0000112000000003 0000000200000003 0000000000000001\r\njuil. 01 07:56:39 RAM kernel:  0000004007300403 0000060300000000 0000000000000000 0000000000000000\r\njuil. 01 07:56:39 RAM kernel: Call Trace:\r\njuil. 01 07:56:39 RAM kernel:  [<ffffffffa000c000>] ? 0xffffffffa000c000\r\njuil. 01 07:56:39 RAM kernel:  [<ffffffff81002128>] do_one_initcall+0xb8/0x200\r\njuil. 01 07:56:39 RAM kernel:  [<ffffffff81574183>] do_init_module+0x60/0x1cb\r\njuil. 01 07:56:39 RAM kernel:  [<ffffffff810fc68a>] load_module+0x216a/0x27c0\r\njuil. 01 07:56:39 RAM kernel:  [<ffffffff810f86a0>] ? store_uevent+0x70/0x70\r\njuil. 01 07:56:39 RAM kernel:  [<ffffffff810fcf3e>] SyS_finit_module+0xbe/0xf0\r\njuil. 01 07:56:39 RAM kernel:  [<ffffffff8157a709>] system_call_fastpath+0x12/0x17\r\njuil. 01 07:56:39 RAM kernel: Code: 48 31 c9 0f a2 48 c1 e8 1a 48 83 e0 3f 48 83 c0 01 ba 01 00 00 00 85 c0 4c 8b 05 6f 1e 60 e1 48 8b 3d 58 1e 60 e1 0f 44 c2 31 d2 <89> 83 ac 00 00 00 48 8b 35 ce 11 3f 00 3b 96 ac 00 00 00 73 62 \r\njuil. 01 07:56:39 RAM kernel: RIP  [<ffffffffa000c185>] IntelFreq_init+0x185/0x1000 [intelfreq]\r\njuil. 01 07:56:39 RAM kernel:  RSP <ffff8802f20fbbe8>\r\njuil. 01 07:56:39 RAM kernel: CR2: 0000000001c000eb\r\njuil. 01 07:56:39 RAM kernel: ---[ end trace e2aa353375bb4913 ]-﻿"},"comment":{"url":"https://api.github.com/repos/cyring/CoreFreq/issues/comments/120984833","html_url":"https://github.com/cyring/CoreFreq/issues/2#issuecomment-120984833","issue_url":"https://api.github.com/repos/cyring/CoreFreq/issues/2","id":120984833,"user":{"login":"cyring","id":11563789,"avatar_url":"https://avatars.githubusercontent.com/u/11563789?v=3","gravatar_id":"","url":"https://api.github.com/users/cyring","html_url":"https://github.com/cyring","followers_url":"https://api.github.com/users/cyring/followers","following_url":"https://api.github.com/users/cyring/following{/other_user}","gists_url":"https://api.github.com/users/cyring/gists{/gist_id}","starred_url":"https://api.github.com/users/cyring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyring/subscriptions","organizations_url":"https://api.github.com/users/cyring/orgs","repos_url":"https://api.github.com/users/cyring/repos","events_url":"https://api.github.com/users/cyring/events{/privacy}","received_events_url":"https://api.github.com/users/cyring/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T16:19:45Z","updated_at":"2015-07-13T16:19:45Z","body":"Allocation fixed"}}