]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/backing-dev.c
checkpatch: improve --git <commit-count> shortcut
[karo-tx-linux.git] / mm / backing-dev.c
index bfbd7096b6edc3c5e87398e93507cb124661b3ab..ed173b8ae8f24a317e11da29735f0a5faa9e361e 100644 (file)
@@ -898,7 +898,7 @@ static atomic_t nr_wb_congested[2];
 void clear_wb_congested(struct bdi_writeback_congested *congested, int sync)
 {
        wait_queue_head_t *wqh = &congestion_wqh[sync];
-       enum wb_state bit;
+       enum wb_congested_state bit;
 
        bit = sync ? WB_sync_congested : WB_async_congested;
        if (test_and_clear_bit(bit, &congested->state))
@@ -911,7 +911,7 @@ EXPORT_SYMBOL(clear_wb_congested);
 
 void set_wb_congested(struct bdi_writeback_congested *congested, int sync)
 {
-       enum wb_state bit;
+       enum wb_congested_state bit;
 
        bit = sync ? WB_sync_congested : WB_async_congested;
        if (!test_and_set_bit(bit, &congested->state))
@@ -957,9 +957,8 @@ EXPORT_SYMBOL(congestion_wait);
  * jiffies for either a BDI to exit congestion of the given @sync queue
  * or a write to complete.
  *
- * In the absence of zone congestion, a short sleep or a cond_resched is
- * performed to yield the processor and to allow other subsystems to make
- * a forward progress.
+ * In the absence of zone congestion, cond_resched() is called to yield
+ * the processor if necessary but otherwise does not sleep.
  *
  * The return value is 0 if the sleep is for the full timeout. Otherwise,
  * it is the number of jiffies that were still remaining when the function
@@ -979,20 +978,7 @@ long wait_iff_congested(struct zone *zone, int sync, long timeout)
         */
        if (atomic_read(&nr_wb_congested[sync]) == 0 ||
            !test_bit(ZONE_CONGESTED, &zone->flags)) {
-
-               /*
-                * Memory allocation/reclaim might be called from a WQ
-                * context and the current implementation of the WQ
-                * concurrency control doesn't recognize that a particular
-                * WQ is congested if the worker thread is looping without
-                * ever sleeping. Therefore we have to do a short sleep
-                * here rather than calling cond_resched().
-                */
-               if (current->flags & PF_WQ_WORKER)
-                       schedule_timeout_uninterruptible(1);
-               else
-                       cond_resched();
-
+               cond_resched();
                /* In case we scheduled, work out time remaining */
                ret = timeout - (jiffies - start);
                if (ret < 0)