Skip to content

task_work: restore fifo ordering guarantee

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fput: don't abuse task_work_add() when possiblefs/file_table.c include/linux/fs.h+31 -70 replies
2/3fput: move ->f_next_put into a union with ->f_versioninclude/linux/fs.h+4 -20 replies
3/3Revert "task_work: remove fifo ordering guarantee"kernel/task_work.c+10 -25 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] task_work: restore fifo ordering guarantee

OK, nobody replied, I will spam you again. Modulo some cosmetic changes this is the same patch, now with the changelog and I tried to test it.

Eric, Al, Linus, I will appreciate any comment. I still disagree with the recent c82199061009 "task_work: remove fifo ordering guarantee".

I am not very sure about 2/3, so it comes as a separate change.

I used this trivial test-case

	#include <stdio.h>
	#include <unistd.h>
	#include <sys/wait.h>
	#include <stdlib.h>
	#include <fcntl.h>
	#include <assert.h>

	int main(int argc, const char *argv[])
	{
		int nfork = atoi(argv[1]);
		int nopen = atoi(argv[2]);

		while (nfork--) {
			if (fork()) {
				wait(NULL);
				continue;
			}

			while (nopen--)
				assert(open("/dev/null", O_RDONLY) >= 0);
			break;
		}

		return 0;
	}

to test the performance, and I see the same numbers with or without this series. Well, actually the numbers look a little bit better when I do "time ./o 10 1000000", but most probably this is just a noise.

Please review.

Oleg.

 fs/file_table.c    |   46 +++++++++++++++++++++++++++++++++++++++-------
 include/linux/fs.h |    5 ++++-
 kernel/task_work.c |   12 ++++++++++--
 3 files changed, 53 insertions(+), 10 deletions(-)