)]}'
{
  "log": [
    {
      "commit": "28d82dc1c4edbc352129f97f4ca22624d1fe61de",
      "tree": "a6fbd269d17134ff42597b4e02eba4345bf6d901",
      "parents": [
        "2ccd4f4d4737b37e21dd92c8c584c23cd87740a2"
      ],
      "author": {
        "name": "Jason Baron",
        "email": "jbaron@redhat.com",
        "time": "Thu Jan 12 17:17:43 2012 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Jan 12 20:13:04 2012 -0800"
      },
      "message": "epoll: limit paths\n\nThe current epoll code can be tickled to run basically indefinitely in\nboth loop detection path check (on ep_insert()), and in the wakeup paths.\nThe programs that tickle this behavior set up deeply linked networks of\nepoll file descriptors that cause the epoll algorithms to traverse them\nindefinitely.  A couple of these sample programs have been previously\nposted in this thread: https://lkml.org/lkml/2011/2/25/297.\n\nTo fix the loop detection path check algorithms, I simply keep track of\nthe epoll nodes that have been already visited.  Thus, the loop detection\nbecomes proportional to the number of epoll file descriptor and links.\nThis dramatically decreases the run-time of the loop check algorithm.  In\none diabolical case I tried it reduced the run-time from 15 mintues (all\nin kernel time) to .3 seconds.\n\nFixing the wakeup paths could be done at wakeup time in a similar manner\nby keeping track of nodes that have already been visited, but the\ncomplexity is harder, since there can be multiple wakeups on different\ncpus...Thus, I\u0027ve opted to limit the number of possible wakeup paths when\nthe paths are created.\n\nThis is accomplished, by noting that the end file descriptor points that\nare found during the loop detection pass (from the newly added link), are\nactually the sources for wakeup events.  I keep a list of these file\ndescriptors and limit the number and length of these paths that emanate\nfrom these \u0027source file descriptors\u0027.  In the current implemetation I\nallow 1000 paths of length 1, 500 of length 2, 100 of length 3, 50 of\nlength 4 and 10 of length 5.  Note that it is sufficient to check the\n\u0027source file descriptors\u0027 reachable from the newly added link, since no\nother \u0027source file descriptors\u0027 will have newly added links.  This allows\nus to check only the wakeup paths that may have gotten too long, and not\nre-check all possible wakeup paths on the system.\n\nIn terms of the path limit selection, I think its first worth noting that\nthe most common case for epoll, is probably the model where you have 1\nepoll file descriptor that is monitoring n number of \u0027source file\ndescriptors\u0027.  In this case, each \u0027source file descriptor\u0027 has a 1 path of\nlength 1.  Thus, I believe that the limits I\u0027m proposing are quite\nreasonable and in fact may be too generous.  Thus, I\u0027m hoping that the\nproposed limits will not prevent any workloads that currently work to\nfail.\n\nIn terms of locking, I have extended the use of the \u0027epmutex\u0027 to all\nepoll_ctl add and remove operations.  Currently its only used in a subset\nof the add paths.  I need to hold the epmutex, so that we can correctly\ntraverse a coherent graph, to check the number of paths.  I believe that\nthis additional locking is probably ok, since its in the setup/teardown\npaths, and doesn\u0027t affect the running paths, but it certainly is going to\nadd some extra overhead.  Also, worth noting is that the epmuex was\nrecently added to the ep_ctl add operations in the initial path loop\ndetection code using the argument that it was not on a critical path.\n\nAnother thing to note here, is the length of epoll chains that is allowed.\nCurrently, eventpoll.c defines:\n\n/* Maximum number of nesting allowed inside epoll sets */\n#define EP_MAX_NESTS 4\n\nThis basically means that I am limited to a graph depth of 5 (EP_MAX_NESTS\n+ 1).  However, this limit is currently only enforced during the loop\ncheck detection code, and only when the epoll file descriptors are added\nin a certain order.  Thus, this limit is currently easily bypassed.  The\nnewly added check for wakeup paths, stricly limits the wakeup paths to a\nlength of 5, regardless of the order in which ep\u0027s are linked together.\nThus, a side-effect of the new code is a more consistent enforcement of\nthe graph depth.\n\nThus far, I\u0027ve tested this, using the sample programs previously\nmentioned, which now either return quickly or return -EINVAL.  I\u0027ve also\ntesting using the piptest.c epoll tester, which showed no difference in\nperformance.  I\u0027ve also created a number of different epoll networks and\ntested that they behave as expectded.\n\nI believe this solves the original diabolical test cases, while still\npreserving the sane epoll nesting.\n\nSigned-off-by: Jason Baron \u003cjbaron@redhat.com\u003e\nCc: Nelson Elhage \u003cnelhage@ksplice.com\u003e\nCc: Davide Libenzi \u003cdavidel@xmailserver.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "25985edcedea6396277003854657b5f3cb31a628",
      "tree": "f026e810210a2ee7290caeb737c23cb6472b7c38",
      "parents": [
        "6aba74f2791287ec407e0f92487a725a25908067"
      ],
      "author": {
        "name": "Lucas De Marchi",
        "email": "lucas.demarchi@profusion.mobi",
        "time": "Wed Mar 30 22:57:33 2011 -0300"
      },
      "committer": {
        "name": "Lucas De Marchi",
        "email": "lucas.demarchi@profusion.mobi",
        "time": "Thu Mar 31 11:26:23 2011 -0300"
      },
      "message": "Fix common misspellings\n\nFixes generated by \u0027codespell\u0027 and manually reviewed.\n\nSigned-off-by: Lucas De Marchi \u003clucas.demarchi@profusion.mobi\u003e\n"
    },
    {
      "commit": "684999149002dd046269666a390458e0acb38280",
      "tree": "b12ea4a953ba2bd90428092e7f35a222a4109510",
      "parents": [
        "041b62374c7fedc11a8a1eeda2868612d3d1436c"
      ],
      "author": {
        "name": "Jonathan Corbet",
        "email": "corbet@lwn.net",
        "time": "Fri Feb 06 13:52:43 2009 -0700"
      },
      "committer": {
        "name": "Jonathan Corbet",
        "email": "corbet@lwn.net",
        "time": "Mon Mar 16 08:32:27 2009 -0600"
      },
      "message": "Rename struct file-\u003ef_ep_lock\n\nThis lock moves out of the CONFIG_EPOLL ifdef and becomes f_lock.  For now,\nepoll remains the only user, but a future patch will use it to protect\nf_flags as well.\n\nCc: Davide Libenzi \u003cdavidel@xmailserver.org\u003e\nReviewed-by: Christoph Hellwig \u003chch@lst.de\u003e\nSigned-off-by: Jonathan Corbet \u003ccorbet@lwn.net\u003e\n"
    },
    {
      "commit": "9fe5ad9c8cef9ad5873d8ee55d1cf00d9b607df0",
      "tree": "49fb04cf552192e566d2aa6e18f40585230cba5a",
      "parents": [
        "e38b36f325153eaadd1c2a7abc5762079233e540"
      ],
      "author": {
        "name": "Ulrich Drepper",
        "email": "drepper@redhat.com",
        "time": "Wed Jul 23 21:29:43 2008 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Jul 24 10:47:29 2008 -0700"
      },
      "message": "flag parameters add-on: remove epoll_create size param\n\nRemove the size parameter from the new epoll_create syscall and renames the\nsyscall itself.  The updated test program follows.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n#include \u003cfcntl.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003ctime.h\u003e\n#include \u003cunistd.h\u003e\n#include \u003csys/syscall.h\u003e\n\n#ifndef __NR_epoll_create2\n# ifdef __x86_64__\n#  define __NR_epoll_create2 291\n# elif defined __i386__\n#  define __NR_epoll_create2 329\n# else\n#  error \"need __NR_epoll_create2\"\n# endif\n#endif\n\n#define EPOLL_CLOEXEC O_CLOEXEC\n\nint\nmain (void)\n{\n  int fd \u003d syscall (__NR_epoll_create2, 0);\n  if (fd \u003d\u003d -1)\n    {\n      puts (\"epoll_create2(0) failed\");\n      return 1;\n    }\n  int coe \u003d fcntl (fd, F_GETFD);\n  if (coe \u003d\u003d -1)\n    {\n      puts (\"fcntl failed\");\n      return 1;\n    }\n  if (coe \u0026 FD_CLOEXEC)\n    {\n      puts (\"epoll_create2(0) set close-on-exec flag\");\n      return 1;\n    }\n  close (fd);\n\n  fd \u003d syscall (__NR_epoll_create2, EPOLL_CLOEXEC);\n  if (fd \u003d\u003d -1)\n    {\n      puts (\"epoll_create2(EPOLL_CLOEXEC) failed\");\n      return 1;\n    }\n  coe \u003d fcntl (fd, F_GETFD);\n  if (coe \u003d\u003d -1)\n    {\n      puts (\"fcntl failed\");\n      return 1;\n    }\n  if ((coe \u0026 FD_CLOEXEC) \u003d\u003d 0)\n    {\n      puts (\"epoll_create2(EPOLL_CLOEXEC) set close-on-exec flag\");\n      return 1;\n    }\n  close (fd);\n\n  puts (\"OK\");\n\n  return 0;\n}\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSigned-off-by: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nAcked-by: Davide Libenzi \u003cdavidel@xmailserver.org\u003e\nCc: Michael Kerrisk \u003cmtk.manpages@googlemail.com\u003e\nCc: \u003clinux-arch@vger.kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "a0998b50c3f0b8fdd265c63e0032f86ebe377dbf",
      "tree": "9132ecb7ef925374edabcaeea44e0287eb5043f4",
      "parents": [
        "11fcb6c14676023d0bd437841f5dcd670e7990a0"
      ],
      "author": {
        "name": "Ulrich Drepper",
        "email": "drepper@redhat.com",
        "time": "Wed Jul 23 21:29:27 2008 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Jul 24 10:47:28 2008 -0700"
      },
      "message": "flag parameters: epoll_create\n\nThis patch adds the new epoll_create2 syscall.  It extends the old epoll_create\nsyscall by one parameter which is meant to hold a flag value.  In this\npatch the only flag support is EPOLL_CLOEXEC which causes the close-on-exec\nflag for the returned file descriptor to be set.\n\nA new name EPOLL_CLOEXEC is introduced which in this implementation must\nhave the same value as O_CLOEXEC.\n\nThe following test must be adjusted for architectures other than x86 and\nx86-64 and in case the syscall numbers changed.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n#include \u003cfcntl.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003ctime.h\u003e\n#include \u003cunistd.h\u003e\n#include \u003csys/syscall.h\u003e\n\n#ifndef __NR_epoll_create2\n# ifdef __x86_64__\n#  define __NR_epoll_create2 291\n# elif defined __i386__\n#  define __NR_epoll_create2 329\n# else\n#  error \"need __NR_epoll_create2\"\n# endif\n#endif\n\n#define EPOLL_CLOEXEC O_CLOEXEC\n\nint\nmain (void)\n{\n  int fd \u003d syscall (__NR_epoll_create2, 1, 0);\n  if (fd \u003d\u003d -1)\n    {\n      puts (\"epoll_create2(0) failed\");\n      return 1;\n    }\n  int coe \u003d fcntl (fd, F_GETFD);\n  if (coe \u003d\u003d -1)\n    {\n      puts (\"fcntl failed\");\n      return 1;\n    }\n  if (coe \u0026 FD_CLOEXEC)\n    {\n      puts (\"epoll_create2(0) set close-on-exec flag\");\n      return 1;\n    }\n  close (fd);\n\n  fd \u003d syscall (__NR_epoll_create2, 1, EPOLL_CLOEXEC);\n  if (fd \u003d\u003d -1)\n    {\n      puts (\"epoll_create2(EPOLL_CLOEXEC) failed\");\n      return 1;\n    }\n  coe \u003d fcntl (fd, F_GETFD);\n  if (coe \u003d\u003d -1)\n    {\n      puts (\"fcntl failed\");\n      return 1;\n    }\n  if ((coe \u0026 FD_CLOEXEC) \u003d\u003d 0)\n    {\n      puts (\"epoll_create2(EPOLL_CLOEXEC) set close-on-exec flag\");\n      return 1;\n    }\n  close (fd);\n\n  puts (\"OK\");\n\n  return 0;\n}\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSigned-off-by: Ulrich Drepper \u003cdrepper@redhat.com\u003e\nAcked-by: Davide Libenzi \u003cdavidel@xmailserver.org\u003e\nCc: Michael Kerrisk \u003cmtk.manpages@googlemail.com\u003e\nCc: \u003clinux-arch@vger.kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "ca5cd877ae699e758e6f26efc11b01bf6631d427",
      "tree": "f2337ce76ab006d9705b10e8e0ed2f62487c837f",
      "parents": [
        "2a397e82c7db18019e408f953dd58dc1963a328c"
      ],
      "author": {
        "name": "Al Viro",
        "email": "viro@ftp.linux.org.uk",
        "time": "Mon Oct 29 04:31:16 2007 +0000"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Mon Oct 29 07:41:32 2007 -0700"
      },
      "message": "x86 merge fallout: uml\n\nDon\u0027t undef __i386__/__x86_64__ in uml anymore, make sure that (few) places\nthat required adjusting the ifdefs got those.\n\nSigned-off-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "d75e26a8298f84bca66374e98fa69049f26083ba",
      "tree": "9893112e17b0085d7bf938a05fa262d04e2fd866",
      "parents": [
        "3899210ad9850e3b8909674c92dccbd3caaf9750"
      ],
      "author": {
        "name": "Jeff Dike",
        "email": "jdike@addtoit.com",
        "time": "Mon Mar 26 21:32:20 2007 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Mar 27 09:05:15 2007 -0700"
      },
      "message": "[PATCH] uml: fix epoll\n\nUML/x86_64 needs the same packing of struct epoll_event as x86_64.\n\nSigned-off-by: Jeff Dike \u003cjdike@linux.intel.com\u003e\nCc: Davide Libenzi \u003cdavidel@xmailserver.org\u003e\nCc: \u003cstable@kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "3419b23a919698f75944d3e0d97eb1d9c51e4bb6",
      "tree": "e1b4b6aad754c6a40137c0a563d823074501da2d",
      "parents": [
        "4ad3bcf3146aa12f41262bb5dd1d9f1778e085b1"
      ],
      "author": {
        "name": "Davide Libenzi",
        "email": "davidel@xmailserver.org",
        "time": "Sun Jun 25 05:48:14 2006 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Sun Jun 25 10:01:13 2006 -0700"
      },
      "message": "[PATCH] epoll: use unlocked wqueue operations\n\nA few days ago Arjan signaled a lockdep red flag on epoll locks, and\nprecisely between the epoll\u0027s device structure lock (-\u003elock) and the wait\nqueue head lock (-\u003elock).\n\nLike I explained in another email, and directly to Arjan, this can\u0027t happen\nin reality because of the explicit check at eventpoll.c:592, that does not\nallow to drop an epoll fd inside the same epoll fd.  Since lockdep is\nworking on per-structure locks, it will never be able to know of policies\nenforced in other parts of the code.\n\nIt was decided time ago of having the ability to drop epoll fds inside\nother epoll fds, that triggers a very trick wakeup operations (due to\npossibly reentrant callback-driven wakeups) handled by the\nep_poll_safewake() function.  While looking again at the code though, I\nnoticed that all the operations done on the epoll\u0027s main structure wait\nqueue head (-\u003ewq) are already protected by the epoll lock (-\u003elock), so that\nlocked-style functions can be used to manipulate the -\u003ewq member.  This\nmakes both a lock-acquire save, and lockdep happy.\n\nRunning totalmess on my dual opteron for a while did not reveal any problem\nso far:\n\nhttp://www.xmailserver.org/totalmess.c\n\nSigned-off-by: Davide Libenzi \u003cdavidel@xmailserver.org\u003e\nCc: Arjan van de Ven \u003carjan@linux.intel.com\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "5a6b7951bfcca7f45f44269ea87417c74558daf8",
      "tree": "f9cc8b3f89c89802e81b37d77c6f698e373bfe51",
      "parents": [
        "0b2fcfdb8b4e7e379192f24ea2203163ddf5df1d"
      ],
      "author": {
        "name": "Benjamin LaHaise",
        "email": "bcrl@linux.intel.com",
        "time": "Thu Mar 23 03:01:03 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Thu Mar 23 07:38:17 2006 -0800"
      },
      "message": "[PATCH] get_empty_filp tweaks, inline epoll_init_file()\n\nEliminate a handful of cache references by keeping current in a register\ninstead of reloading (helps x86) and avoiding the overhead of a function\ncall.  Inlining eventpoll_init_file() saves 24 bytes.  Also reorder file\ninitialization to make writes occur more sequentially.\n\nSigned-off-by: Benjamin LaHaise \u003cbcrl@linux.intel.com\u003e\nCc: Davide Libenzi \u003cdavidel@xmailserver.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
      "tree": "0bba044c4ce775e45a88a51686b5d9f90697ea9d",
      "parents": [],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@ppc970.osdl.org",
        "time": "Sat Apr 16 15:20:36 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@ppc970.osdl.org",
        "time": "Sat Apr 16 15:20:36 2005 -0700"
      },
      "message": "Linux-2.6.12-rc2\n\nInitial git repository build. I\u0027m not bothering with the full history,\neven though we have it. We can create a separate \"historical\" git\narchive of that later if we want to, and in the meantime it\u0027s about\n3.2GB when imported into git - space that would just make the early\ngit days unnecessarily complicated, when we don\u0027t have a lot of good\ninfrastructure for it.\n\nLet it rip!\n"
    }
  ]
}
