+ proc-add-a-reschedule-point-in-proc_readfd_common.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: proc: add a reschedule point in proc_readfd_common()
has been added to the -mm tree.  Its filename is
     proc-add-a-reschedule-point-in-proc_readfd_common.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/proc-add-a-reschedule-point-in-proc_readfd_common.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/proc-add-a-reschedule-point-in-proc_readfd_common.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Eric Dumazet <edumazet@xxxxxxxxxx>
Subject: proc: add a reschedule point in proc_readfd_common()

User can pass an arbitrary large buffer to getdents().

It is typically a 32KB buffer used by libc scandir() implementation.

When scanning /proc/{pid}/fd, we can hold cpu way too long, so add a
cond_resched() to be kind with other tasks.

We've seen latencies of more than 50ms on real workloads.

Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/proc/fd.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN fs/proc/fd.c~proc-add-a-reschedule-point-in-proc_readfd_common fs/proc/fd.c
--- a/fs/proc/fd.c~proc-add-a-reschedule-point-in-proc_readfd_common
+++ a/fs/proc/fd.c
@@ -258,6 +258,7 @@ static int proc_readfd_common(struct fil
 				     name, len, instantiate, p,
 				     (void *)(unsigned long)fd))
 			goto out_fd_loop;
+		cond_resched();
 		rcu_read_lock();
 	}
 	rcu_read_unlock();
_

Patches currently in -mm which might be from edumazet@xxxxxxxxxx are

proc-add-a-reschedule-point-in-proc_readfd_common.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux