diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-06-18 20:03:30 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-06-18 20:05:48 +0100 |
commit | b3f288de7c8add67a3364e989b865b6537838662 (patch) | |
tree | 389c80ae471e4e24f25e6c38862a89ee5d833d86 /ipc/sem.c | |
parent | 04e71d72abec3e1a2b2ac10f96ced1a471ecb3aa (diff) | |
parent | 8d962507007357d6fbbcbdd1647faa389a9aed6d (diff) |
Merge branch 'for-rmk/hugepages' of git://git.linaro.org/people/stevecapper/linux into devel-stable
These changes bring both HugeTLB support and Transparent HugePage
(THP) support to ARM. Only long descriptors (LPAE) are supported
in this series.
The code has been tested on an Arndale board (Exynos 5250).
Diffstat (limited to 'ipc/sem.c')
-rw-r--r-- | ipc/sem.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/ipc/sem.c b/ipc/sem.c index a7e40ed8a07..70480a3aa69 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -752,19 +752,29 @@ static void do_smart_update(struct sem_array *sma, struct sembuf *sops, int nsop int otime, struct list_head *pt) { int i; + int progress; - if (sma->complex_count || sops == NULL) { - if (update_queue(sma, -1, pt)) + progress = 1; +retry_global: + if (sma->complex_count) { + if (update_queue(sma, -1, pt)) { + progress = 1; otime = 1; + sops = NULL; + } } + if (!progress) + goto done; if (!sops) { /* No semops; something special is going on. */ for (i = 0; i < sma->sem_nsems; i++) { - if (update_queue(sma, i, pt)) + if (update_queue(sma, i, pt)) { otime = 1; + progress = 1; + } } - goto done; + goto done_checkretry; } /* Check the semaphores that were modified. */ @@ -772,8 +782,15 @@ static void do_smart_update(struct sem_array *sma, struct sembuf *sops, int nsop if (sops[i].sem_op > 0 || (sops[i].sem_op < 0 && sma->sem_base[sops[i].sem_num].semval == 0)) - if (update_queue(sma, sops[i].sem_num, pt)) + if (update_queue(sma, sops[i].sem_num, pt)) { otime = 1; + progress = 1; + } + } +done_checkretry: + if (progress) { + progress = 0; + goto retry_global; } done: if (otime) |