Re: [PATCH] ltq-dsl-base: only lock the dsl pipe once for all stats

2020-12-11 Thread Andre Heider
On 04/12/2020 13:25, Andre Heider wrote: Hi, On 04/12/2020 13:03, Jo-Philipp Wich wrote: Hi, is there any reason not to use the flock style below? It should be more reliable wrt. unlocking if the script is prematurely terminated. I guess because it gets more difficult to fish out the answer

Re: [PATCH] ltq-dsl-base: only lock the dsl pipe once for all stats

2020-12-04 Thread Andre Heider
On 04/12/2020 13:25, Andre Heider wrote: Hi, On 04/12/2020 13:03, Jo-Philipp Wich wrote: Hi, is there any reason not to use the flock style below? It should be more reliable wrt. unlocking if the script is prematurely terminated. I guess because it gets more difficult to fish out the answer

Re: [PATCH] ltq-dsl-base: only lock the dsl pipe once for all stats

2020-12-04 Thread Andre Heider
Hi, On 04/12/2020 13:03, Jo-Philipp Wich wrote: Hi, is there any reason not to use the flock style below? It should be more reliable wrt. unlocking if the script is prematurely terminated. I guess because it gets more difficult to fish out the answer for each command then (I didn't check if

Re: [PATCH] ltq-dsl-base: only lock the dsl pipe once for all stats

2020-12-04 Thread Florian Eckert
Hi is there any reason not to use the flock style below? It should be more reliable wrt. unlocking if the script is prematurely terminated. -- 8< -- { flock -x 1000 command command command ... } 1000>/var/lock/dsl_pipe -- >8 -- We could also use the

Re: [PATCH] ltq-dsl-base: only lock the dsl pipe once for all stats

2020-12-04 Thread Jo-Philipp Wich
Hi, is there any reason not to use the flock style below? It should be more reliable wrt. unlocking if the script is prematurely terminated. -- 8< -- { flock -x 1000 command command command ... } 1000>/var/lock/dsl_pipe -- >8 -- See also the fourth example at

RE: [PATCH] ltq-dsl-base: only lock the dsl pipe once for all stats

2020-12-04 Thread Adrian Schmutzler
Hi, > -Original Message- > From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] > On Behalf Of Andre Heider > Sent: Freitag, 4. Dezember 2020 08:44 > To: openwrt-devel@lists.openwrt.org > Subject: [PATCH] ltq-dsl-base: only lock the dsl pipe once for all

[PATCH] ltq-dsl-base: only lock the dsl pipe once for all stats

2020-12-03 Thread Andre Heider
Instead of locking/unlocking it for every command. Reduces the runtime for the dslstat/lucistat commands to ~66%. Before: real0m 2.66s user0m 0.90s sys 0m 1.76s After: real0m 1.76s user0m 0.63s sys 0m 1.13s Signed-off-by: Andre Heider ---