#1140605 nginx: Cache line size on loong64 may be too small

#1140605#5
Date:
2026-06-23 11:30:23 UTC
From:
To:
I noticed that debusine's autopkgtests are failing on loong64 (e.g.
https://ci.debian.net/packages/d/debusine/testing/loong64/72375884/).
On investigation, I found this in its test artifacts:

  Jun 22 10:47:53 ci-173-ef19176d nginx[8035]: 2026/06/22 10:47:53 [emerg] 8035#8035: could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
  Jun 22 10:47:53 ci-173-ef19176d nginx[8035]: nginx: configuration file /etc/nginx/nginx.conf test failed

I suppose we could work around this in debusine, as suggested in
https://nginx.org/en/docs/http/server_names.html#optimization.  However,
I think this message points to nginx being configured suboptimally on
this architecture.  The default value of server_names_hash_bucket_size
is set to nginx's idea of the CPU cache line size.  Looking at
https://salsa.debian.org/nginx-team/nginx/-/blob/debian/latest/auto/os/conf,
it seems that this is set based on matching the architecture name.  No
specific value is set for the case where $NGX_MACHINE is loongarch64, so
it falls back to 32.

I'm not an architecture expert, but looking at e.g.
https://github.com/golang/go/blob/master/src/internal/cpu/cpu_loong64.go
it seems as though 64 might be a better choice on this architecture.
Could anyone on debian-loongarch@ confirm or contradict this?

Thanks,

#1140605#10
Date:
2026-06-24 06:24:50 UTC
From:
To:
Hi,

在 2026/6/23 19:30, Colin Watson 写道:
Your investigation is appreciate!
affected Meltdown: Not affected Mmio stale data: Not affected Old microcode: Not affected Reg file data sampling: Not affected Retbleed: Not affected Spec rstack overflow: Not affected Spec store bypass: Not affected Spectre v1: Mitigation; __user pointer sanitization Spectre v2: Not affected Srbds: Not affected Tsa: Not affected Tsx async abort: Not affected Vmscape: Not affected root@klx:~# cat /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size 64 I also confirm this through the Chinese Wechat group with staff in loongson company. Regards,

#1140605#15
Date:
2026-06-24 20:35:51 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
nginx, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1140605@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jan Mojžíš <janmojzis@debian.org> (supplier of updated nginx package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 24 Jun 2026 19:29:57 +0000
Source: nginx
Architecture: source
Version: 1.30.1-6
Distribution: unstable
Urgency: medium
Maintainer: Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>
Changed-By: Jan Mojžíš <janmojzis@debian.org>
Closes: 1124757 1140361 1140605
Changes:
 nginx (1.30.1-6) unstable; urgency=medium
 .
   * d/p/fix-cache-line-size-for-loongarch64.patch add,
     backport loongarch64 detection and set cache line size 64
     (Closes: 1140605)
   * d/control: add `Suggests logrotate` for nginx-common (Closes: 1124757)
   * d/changelog: fix the 1.30.1-5 entry, which already closed bug #1140361
     (Closes: 1140361)
Checksums-Sha1:
 379867e41016146fc6d9f4e5e7ec4e0ca835df84 3803 nginx_1.30.1-6.dsc
 c587557aa93c83009f036a6c2eef0d50e78781e5 78572 nginx_1.30.1-6.debian.tar.xz
 f70703dc045d411a4825c663d52e256f07def524 3121372 nginx_1.30.1-6.git.tar.xz
 b2807788f9ff57c3c3f922147c89d66f116c906f 17484 nginx_1.30.1-6_source.buildinfo
Checksums-Sha256:
 cf842aefd9ac755c25fe6976cd329922c749b8daa747cf3a78e809805ca71180 3803 nginx_1.30.1-6.dsc
 e6b592a38c1dc3358e9230b6ec912d4663e12234ff951cb764531cb788dda69c 78572 nginx_1.30.1-6.debian.tar.xz
 2f43ef3dea7f9f44ad853b095c1a7dec134a98e1c9c77ac8b8489357e60debdb 3121372 nginx_1.30.1-6.git.tar.xz
 933b011b6624b3d2135b167da7c8b6e44c43f73c53d97ec4b279d2111fb9e914 17484 nginx_1.30.1-6_source.buildinfo
Files:
 f29a6e17511ce7b111af09808b14ba4f 3803 httpd optional nginx_1.30.1-6.dsc
 f9f2c90464a04d4caee0eee5dcf54b8f 78572 httpd optional nginx_1.30.1-6.debian.tar.xz
 fb0ccd397b78b542d12fac667c165634 3121372 httpd None nginx_1.30.1-6.git.tar.xz
 bafa2c7c338723bf5ebe39f5f815554b 17484 httpd optional nginx_1.30.1-6_source.buildinfo
Git-Tag-Info: tag=8f13e9810e558ec9b570bf61f59886ed4b11929f fp=d008b0c23d8479e46b9fcb9045da517496939ff9
Git-Tag-Tagger: Jan Mojžíš <jan.mojzis@gmail.com>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEN02M5NuW6cvUwJcqYG0ITkaDwHkFAmo8NGYACgkQYG0ITkaD
wHlefRAAsRnfmYE05aUQSrtYrdy9EGxewjpRc4EFV+NovhVCiufygAzmEdm7yclL
hdABCAxdY5dO5Ob4fx2dOAR3VKwy0qrBKiSw5jSoVahD/LFUDvGii869QbKZaxuI
39/QI1/G1eaVjk4rBeQN1yz6of+HasK7B74IycKY9IqxyOq3wegsoxC0hNz5YVF9
CXaBLrLkFuq12mHXvkW2fmLMoFmXMKVSYTg9wBvCVn1iQs5HlK+Rd0jZisu118QO
9rR7ksUte8l0hkNE3lYppTO+V3gegMtU00JRZhP9MAe5qGZdNLnnAfOIINapzupm
iXjin67uo460vbe012GKFb77c0LRQtuoRNdGW0aXLgKGa28CqJcTnPVrhMDpUelI
nsVAJk/EqpDUjkfzrhhVtoZc0cont42mLd+11Onn2S71WXrYuil14nstYPSqm5fO
zSXX4+12vrwEhjjMkEfWqSdUksIWWp1Lacalym1T3ni1/XwGMQaf3+DFxvR4HUIW
s6pSoa4qGNmvwjPrWdAApSZNRTQqIJHsTIlDl75Ak8/lJKPySTZt/pbXpfyRmp+9
fcxNu7/CESV4YJESRSyyBYW821SEv2JLM+QUM4P+9owT5PmcgKM3R+W0tuaB9kQ8
sy0NRmy3jkfgJToN58WAnAyFz/8tD8Kuda5nwv5qR8ZEVMw4S0k=
=R91o
-----END PGP SIGNATURE-----

#1140605#20
Date:
2026-06-25 03:49:30 UTC
From:
To:
I'm sorry for my last email, the "line break" is lost.

I use KDE, Thunderbird to send email, when I copy and paste the output from 
Konsole, the "line break" is normal in Thunderbird editor when I see.
But after I send out email, the "line break" is lost.

在 2026/6/24 14:24, xiao sheng wen(肖盛文) 写道:

Your investigation is appreciate!

Yes, 64 is a better choice on loong64 architecture.


The following is run on my test loong64 machine:

root@klx:~# arch

loongarch64

root@klx:~# uname -a

Linux klx 7.0.12+deb14-loong64 #1 SMP PREEMPT Debian 7.0.12-1 (2026-06-09) loongarch64 GNU/Linux


root@klx:~# cat /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size

64

I also confirm this through the Chinese Wechat group with staff in loongson company.



Regards,