Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable tickless wothout kernel rebuild? #750

Closed
gm8arv opened this issue Dec 29, 2014 · 8 comments
Closed

Disable tickless wothout kernel rebuild? #750

gm8arv opened this issue Dec 29, 2014 · 8 comments

Comments

@gm8arv
Copy link

gm8arv commented Dec 29, 2014

I have recent upgraded a number of Raspberry Pi cards to the current distribution, and noted that the timekeeping performance for a stratum-1 server with PPS as reported by NTP offset is a factor of about two worse than with my previous kernel which was compiled without the "tickless" option. Current version: Linux raspi-6 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux

Is there any way to select non-tickless operation at run time - such as a boot command-line option - so that the good timekeeping performance might be restored? I would very much prefer to use the stick kernel rather than recompiling - as the GPIO-PPS support is now built-in and very helpful thanks!

(It was suggested that I post this request here.)

Thanks,
David

@kukabu
Copy link

kukabu commented Dec 29, 2014

Try nohz=off in kernel cmdline.

@gm8arv
Copy link
Author

gm8arv commented Dec 29, 2014

Thanks, kukabu. I tried that but it didn't make any difference. I see now that someone reported similar results earlier. Can you or anyone confirm that the stock Raspian supports nohz=off, and if not, could it be added, please?

@ghost
Copy link

ghost commented Dec 30, 2014

I'd like to second this request. A functioning nohz=off would be a valuable addition for people running or trying to run a stratum 1 NTP server, especially in light of this recent NTP bug fix: http://bugs.ntp.org/show_bug.cgi?id=2314

tl:dr; Until recently on tickless kernels NTP would look as though it were using the kernel clock discipline when instructed to but was in fact silently ignoring it. NTP now correctly fails to use the kernel discipline on tickless kernels, and will only use it on kernels with tickless disabled. So, though we can now easily enable PPS in the Raspbian kernel (hooray), NTP will ignore (and always has ignored) it at the kernel level (not hooray).

@Ruffio
Copy link

Ruffio commented Aug 10, 2016

@gm8arv has this issue been resolved? If yes, please close this issue. Thanks.

@gm8arv
Copy link
Author

gm8arv commented Aug 11, 2016

The comment referred to a rather old version of the OS. Is there now a nohz=on option for the current Raspbian?

@P33M
Copy link
Contributor

P33M commented Aug 11, 2016

Adding nohz=off to /boot/cmdline.txt has the following effects:

Default:

pi@raspberrypi:~$ vmstat 2
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 681776  13860 106112    0    0  1580    32  607  795 10 14 64 12  0
 0  0      0 681280  13860 106140    0    0     0     0  562  259  0  1 99  0  0
 0  0      0 681280  13860 106140    0    0     0     0  336   45  0  0 100  0  0
 0  0      0 681024  13868 106140    0    0     0     6  468  251  1  1 99  0  0
 0  0      0 680892  13868 106140    0    0     0     0  359   80  0  0 100  0  0
 0  0      0 681048  13868 106140    0    0     0     0  435  228  1  1 98  0  0

nohz=off:

pi@raspberrypi:~$ vmstat 2
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 681696  13632 106104    0    0  1072    21  487  562  7 10 76  8  0
 0  0      0 681656  13632 106132    0    0     0     0  806  114  0  0 100  0  0
 0  0      0 681488  13632 106132    0    0     0     0  794  260  1  1 98  0  0
 0  0      0 681504  13632 106132    0    0     0     0  706   73  0  0 100  0  0

So it appears that scheduling interrupts occur far more often. We've also switched to voluntary preemption, which may have a beneficial effect for more precise timestamping.

@P33M P33M closed this as completed Aug 11, 2016
@gm8arv
Copy link
Author

gm8arv commented Aug 11, 2016

Thanks for that, I will test it out here and see whether there really is any difference as far as NTP is concerend.

@gm8arv
Copy link
Author

gm8arv commented Aug 12, 2016

When "nohz=off" was added, on some systems there was no change, on others the NTP jitter was "halved" (approximately). I ended up with: ~ 4 µs jitter on RasPi B/B+, 2 µs on model 2 B, and 1 µs on model 3, when using PPS sources with well under 0.1 µs jitter. Just as a rough guide.

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html#nohz

Thanks again.

popcornmix pushed a commit that referenced this issue Nov 21, 2022
The page table check trigger BUG_ON() unexpectedly when collapse hugepage:

 ------------[ cut here ]------------
 kernel BUG at mm/page_table_check.c:82!
 Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
 Dumping ftrace buffer:
    (ftrace buffer empty)
 Modules linked in:
 CPU: 6 PID: 68 Comm: khugepaged Not tainted 6.1.0-rc3+ #750
 Hardware name: linux,dummy-virt (DT)
 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : page_table_check_clear.isra.0+0x258/0x3f0
 lr : page_table_check_clear.isra.0+0x240/0x3f0
[...]
 Call trace:
  page_table_check_clear.isra.0+0x258/0x3f0
  __page_table_check_pmd_clear+0xbc/0x108
  pmdp_collapse_flush+0xb0/0x160
  collapse_huge_page+0xa08/0x1080
  hpage_collapse_scan_pmd+0xf30/0x1590
  khugepaged_scan_mm_slot.constprop.0+0x52c/0xac8
  khugepaged+0x338/0x518
  kthread+0x278/0x2f8
  ret_from_fork+0x10/0x20
[...]

Since pmd_user_accessible_page() doesn't check if a pmd is leaf, it
decrease file_map_count for a non-leaf pmd comes from collapse_huge_page().
and so trigger BUG_ON() unexpectedly.

Fix this problem by using pmd_leaf() insteal of pmd_present() in
pmd_user_accessible_page(). Moreover, use pud_leaf() for
pud_user_accessible_page() too.

Fixes: 42b2547 ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK")
Reported-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20221117075602.2904324-2-liushixin2@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
herrnst pushed a commit to herrnst/linux-raspberrypi that referenced this issue Nov 26, 2022
[ Upstream commit 5b47348 ]

The page table check trigger BUG_ON() unexpectedly when collapse hugepage:

 ------------[ cut here ]------------
 kernel BUG at mm/page_table_check.c:82!
 Internal error: Oops - BUG: 00000000f2000800 [raspberrypi#1] SMP
 Dumping ftrace buffer:
    (ftrace buffer empty)
 Modules linked in:
 CPU: 6 PID: 68 Comm: khugepaged Not tainted 6.1.0-rc3+ raspberrypi#750
 Hardware name: linux,dummy-virt (DT)
 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : page_table_check_clear.isra.0+0x258/0x3f0
 lr : page_table_check_clear.isra.0+0x240/0x3f0
[...]
 Call trace:
  page_table_check_clear.isra.0+0x258/0x3f0
  __page_table_check_pmd_clear+0xbc/0x108
  pmdp_collapse_flush+0xb0/0x160
  collapse_huge_page+0xa08/0x1080
  hpage_collapse_scan_pmd+0xf30/0x1590
  khugepaged_scan_mm_slot.constprop.0+0x52c/0xac8
  khugepaged+0x338/0x518
  kthread+0x278/0x2f8
  ret_from_fork+0x10/0x20
[...]

Since pmd_user_accessible_page() doesn't check if a pmd is leaf, it
decrease file_map_count for a non-leaf pmd comes from collapse_huge_page().
and so trigger BUG_ON() unexpectedly.

Fix this problem by using pmd_leaf() insteal of pmd_present() in
pmd_user_accessible_page(). Moreover, use pud_leaf() for
pud_user_accessible_page() too.

Fixes: 42b2547 ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK")
Reported-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20221117075602.2904324-2-liushixin2@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
pfpacket pushed a commit to pfpacket/linux-rpi-rust that referenced this issue Apr 7, 2023
rust: add async tcp connection support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants