Open codemarauder opened 3 months ago
Your ramips have one CPU and the assert is that system pointers are not 64bit....
Your ramips have one CPU and the assert is that system pointers are not 64bit....
I have also posted it on squid mailing list and here is the reply:
https://lists.squid-cache.org/pipermail/squid-users/2024-June/026781.html
The assertion in question may be overreaching -- I suspect the relevant
code works correctly when std::atomic<uint64_t>::is_lock_free() is
false. Depending on how those locks are implemented in your environment,
and how your traffic tickles them, SMP Squid without atomic locks might
become very slow! We do not (and, IMO, should not) optimize performance
for environments without lock-free atomics!
I see the following options for going forward:
* Comment out the assertion, void your warranty, and hope for the best.
* Audit relevant code to confirm that the assertion is safe to remove.
* Find a usable OS/environment that has lock-free 64-bit atomics.
> SMP worked fine with squid 4.13 on same architecture.
SMP Squid v4 has an ABA problem that could, at least in theory, result
in silent cache corruption. If you are interested in low-level details,
please see commit 7a5af8db message:
https://github.com/squid-cache/squid/commit/7a5af8db
For x86, it worked once I added the following to /etc/init.d/squid:
mkdir /var/run/squid && chown squid:squid /var/run/squid
mipsel doesn't have lock-free atomics?
Likely \<int> and not
Something tells me this is a result of mips16. mips32 should support lock free atomics.
I commented the assertion
in the code in ipc/mem/PageStack.cc (line 159), re-compiled and am able to run squid in SMP mode with multiple workers on ramips.
I have yet to test the performance and see if it causes any other issues with IPC or otherwise.
Something tells me this is a result of mips16. mips32 should support lock free atomics.
Does that mean MT7621 is mips16 and not mips32?
no.
mips16 is compiled as default for space reasons. You can disable with
PKG_BUILD_FLAGS:=no-mips16
PKG_BUILD_FLAGS:=no-mips16
Adding the above to Makefile and recompiling didn't help. Still getting the following error:
Tue Jul 2 11:30:51 2024 daemon.notice squid[31589]: Processing Configuration File: /tmp/squid/squid.conf (depth 0)
Tue Jul 2 11:30:52 2024 local4.notice squid[31589]: Created PID file (/var/run/squid.pid)
Tue Jul 2 11:30:52 2024 local4.warn squid[31589]: FATAL: assertion failed: mem/PageStack.cc:159: "StoredNode().is_lock_free()"
The assertion assumes 64bit lock id.
The assertion assumes 64bit lock id.
:-(
No other option than to comment the code then as suggested by Alex on squid-users list.
Just change assertion to check for "int" lock id.
Just change assertion to check for "int" lock id.
Changed uint64_t
to uint32_t
in ipc/mem/PageStack.h at line 79.
It is starting with workers now. In code for version 4.x, there is no mention of uint64_t
. It was introduced with 5.x.
No idea about the repercussions or instability. Need to test.
The posix definition is that lock ID is native integer. It should be some conditional in ./sonfigure style portability of squid to run on (most) 32bit platforms.
Maintainer: @krant Environment: x86 (APU, SuperMicro, Generic), ramips (unielec u7621-06, Mikrotik RB750Gr3), 23.05.x and snapshot
Squid supports workers to run parallel kids on multiple cores to utilise SMP. It was working fine until squid version 4.x but stopped working with squid 5.x and squid 6.x on Openwrt.
To enable workers following changes are required:
/etc/squid/squid.conf:
/etc/init.d/squid:
With multiple kids, processes are seen as below:
But with newer squid (5.x and 6.x) on Openwrt 23.05.0 onwards fail to start when workers are enabled (I haven't tested on 22.03.x as jumped to 23.05.x from 21.02.x):
Below is the squid debug log with debug_options 54,9: