Skip to main content
13 votes

Can I watch the progress of a `sync` operation?

Based on the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress: # Create the command watchSync() { watch -n1 'grep -E "(Dirty|...
aggregate1166877's user avatar
9 votes
Accepted

How to attach a listener to sysfs files?

I have not read the source code that populates operstate, but generally, reading a file in sysfs executes some code on the kernel side that returns the bytes you're reading. So, without you reading ...
Marcus Müller's user avatar
7 votes
Accepted

Why does io_uring have a layer of indirection for the submission queue?

I reached out to the author of the paper and got some clarity on this. The reason there's a layer of indirection is because some applications might want to hold submission event data inside their ...
perpetual_check's user avatar
5 votes

How to attach a listener to sysfs files?

As the good Müller already has explained you can not monitor sysfs files as they are part of virtual file system and does not act like normal files. I ended up downing myself into some C, and whilst ...
ibuprofen's user avatar
  • 3,050
3 votes
Accepted

Stopping an asynchronous while loop in a shell script

You need kill $! to kill the last running process at background. see In Bash scripting, what's the meaning of " $! "? if there are other commands you are running in the background, you can ...
αғsнιη's user avatar
  • 41.9k
2 votes

Stopping an asynchronous while loop in a shell script

coproc for simulating named loops The closest to named loops bash has, might be coproc: coproc loop1 { while ((1)) ; do echo a >> aout ; sleep 1 ; done ;} echo PID of loop1 $loop1_PID coproc ...
FelixJN's user avatar
  • 14.1k
2 votes

Can I watch the progress of a `sync` operation?

You can watch current block device I/O traffic with nmon, as in: NMON=ld nmon -s1 (this preselects display of load graph and disk graph with 1 second refresh time.. this can also be set by starting ...
eMPee584's user avatar
  • 373
2 votes
Accepted

How to set interval for an asynchronous command in bash?

one thing to try in order to achieve a degree of asynchronous setting of a variable is: #!/usr/bin/env bash async() { while :; do # send SIGUSR1 to "parent" script kill -USR1 "$1" ...
noAnton's user avatar
  • 369
1 vote

Curl returning with no response and does not wait for `wait=x seconds`

The HTTP response HTTP/1.1 202 Accepted indicates that the request has been accepted for processing, but the processing has not been completed yet. The key is: < location: https://hostname.com/...
Franck Dernoncourt's user avatar
1 vote

How to attach a listener to sysfs files?

I'm not sure if this is quite what you want, but you can monitor the interface state like this: $ ip monitor link dev eth0 What exactly this gets you is slightly dependent on the network device ...
Tom's user avatar
  • 563
1 vote

How to attach a listener to sysfs files?

Apparently a sysfs attribute that is "pollable" also works with inotify. Pollable Attributes There is a mechanism for Linux kernel drivers to make sysfs attributes trigger change events when ...
Craig McQueen's user avatar
1 vote
Accepted

To sync or not to sync in an embedded environment?

Here is my opinion: Sorry for verbosity in advance. When we are specifically talking about ubifs we should always either sync / similar options. ubifs supports write-back caching That means changes ...
HarshaD's user avatar
  • 386
1 vote
Accepted

Enabling Asynchronous IO at HP-UX Operating System

Looks like the three pages are somewhat poorly titled. "Enabling Asynchronous Disk I/O HP-UX" page describes the installation of the asynchronous I/O driver. It would be definitely needed if you ...
telcoM's user avatar
  • 114k
1 vote

Linux AIO / io_submit / io_getevents / on fifo (named pipes)

Linux AIO is not just limited to regular files - it can be used on block device special files. I expect AIO writes cannot be used on pipes though, due to pipes not being capable of seeking. ...
sourcejedi's user avatar
  • 53.6k
1 vote

What does "asynchronous" mean in these cases?

The meaning of “asynchronous” is different in all these cases. In the shell case, & runs a command asynchronously, meaning that the shell regains control as soon as the command starts, and the ...
Stephen Kitt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible