)]}'
{
  "commit": "64c7c8f88559624abdbe12b5da6502e8879f8d28",
  "tree": "02f85a35ddd0f24dec70e5d6ecd61073578fd8d6",
  "parents": [
    "5bfb5d690f36d316a5f3b4f7775fda996faa6b12"
  ],
  "author": {
    "name": "Nick Piggin",
    "email": "nickpiggin@yahoo.com.au",
    "time": "Tue Nov 08 21:39:04 2005 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@g5.osdl.org",
    "time": "Wed Nov 09 07:56:33 2005 -0800"
  },
  "message": "[PATCH] sched: resched and cpu_idle rework\n\nMake some changes to the NEED_RESCHED and POLLING_NRFLAG to reduce\nconfusion, and make their semantics rigid.  Improves efficiency of\nresched_task and some cpu_idle routines.\n\n* In resched_task:\n- TIF_NEED_RESCHED is only cleared with the task\u0027s runqueue lock held,\n  and as we hold it during resched_task, then there is no need for an\n  atomic test and set there. The only other time this should be set is\n  when the task\u0027s quantum expires, in the timer interrupt - this is\n  protected against because the rq lock is irq-safe.\n\n- If TIF_NEED_RESCHED is set, then we don\u0027t need to do anything. It\n  won\u0027t get unset until the task get\u0027s schedule()d off.\n\n- If we are running on the same CPU as the task we resched, then set\n  TIF_NEED_RESCHED and no further action is required.\n\n- If we are running on another CPU, and TIF_POLLING_NRFLAG is *not* set\n  after TIF_NEED_RESCHED has been set, then we need to send an IPI.\n\nUsing these rules, we are able to remove the test and set operation in\nresched_task, and make clear the previously vague semantics of\nPOLLING_NRFLAG.\n\n* In idle routines:\n- Enter cpu_idle with preempt disabled. When the need_resched() condition\n  becomes true, explicitly call schedule(). This makes things a bit clearer\n  (IMO), but haven\u0027t updated all architectures yet.\n\n- Many do a test and clear of TIF_NEED_RESCHED for some reason. According\n  to the resched_task rules, this isn\u0027t needed (and actually breaks the\n  assumption that TIF_NEED_RESCHED is only cleared with the runqueue lock\n  held). So remove that. Generally one less locked memory op when switching\n  to the idle thread.\n\n- Many idle routines clear TIF_POLLING_NRFLAG, and only set it in the inner\n  most polling idle loops. The above resched_task semantics allow it to be\n  set until before the last time need_resched() is checked before going into\n  a halt requiring interrupt wakeup.\n\n  Many idle routines simply never enter such a halt, and so POLLING_NRFLAG\n  can be always left set, completely eliminating resched IPIs when rescheduling\n  the idle task.\n\n  POLLING_NRFLAG width can be increased, to reduce the chance of resched IPIs.\n\nSigned-off-by: Nick Piggin \u003cnpiggin@suse.de\u003e\nCc: Ingo Molnar \u003cmingo@elte.hu\u003e\nCc: Con Kolivas \u003ckernel@kolivas.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "941615a9769b91ea0cee31723023c600645db67d",
      "new_mode": 33188,
      "new_path": "Documentation/sched-arch.txt"
    },
    {
      "type": "modify",
      "old_id": "eb20c3afff585b965a0bf3c2f1eace56b909aacb",
      "old_mode": 33188,
      "old_path": "arch/alpha/kernel/process.c",
      "new_id": "a8682612abc0d8ce46c1979a48b4b6d78f31b7b0",
      "new_mode": 33188,
      "new_path": "arch/alpha/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "93dd92cc12f8baf1c0ed808c45750910416c81d0",
      "old_mode": 33188,
      "old_path": "arch/arm/kernel/process.c",
      "new_id": "c0f6a119de3b903c7bbe44d8d28699473205d3a6",
      "new_mode": 33188,
      "new_path": "arch/arm/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "86e80c551478894c468b4225f72d00a4c772bcfc",
      "old_mode": 33188,
      "old_path": "arch/i386/kernel/apm.c",
      "new_id": "003548b8735f961b24794da2306bff45944ee63e",
      "new_mode": 33188,
      "new_path": "arch/i386/kernel/apm.c"
    },
    {
      "type": "modify",
      "old_id": "5296e284ea363b631f1663204acfd581db5dd01d",
      "old_mode": 33188,
      "old_path": "arch/i386/kernel/process.c",
      "new_id": "1cb261f225d580939785c0b9fc94859dcf92a8a0",
      "new_mode": 33188,
      "new_path": "arch/i386/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "4c621fc3c3b9086da036d4a4390d8d9ac176e0ee",
      "old_mode": 33188,
      "old_path": "arch/ia64/kernel/process.c",
      "new_id": "640d6908f8ec9727525f798fd306af5f981617eb",
      "new_mode": 33188,
      "new_path": "arch/ia64/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "f482f78de43537f0dc97866ab357d2b70823f278",
      "old_mode": 33188,
      "old_path": "arch/parisc/kernel/process.c",
      "new_id": "fee4f1f09adc687b84bcfdd5355a6f1fa3c8a1f4",
      "new_mode": 33188,
      "new_path": "arch/parisc/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "0130f2619dacda2791dd7aaee5f097377dd520a9",
      "old_mode": 33188,
      "old_path": "arch/powerpc/platforms/iseries/setup.c",
      "new_id": "7f8f0cda6a742ca7844c79259c6f5601c8d04b30",
      "new_mode": 33188,
      "new_path": "arch/powerpc/platforms/iseries/setup.c"
    },
    {
      "type": "modify",
      "old_id": "4854f5eb5c3da3954f26590d66e5efc9eb8d6d06",
      "old_mode": 33188,
      "old_path": "arch/powerpc/platforms/pseries/setup.c",
      "new_id": "a093a0d4dd69d15c03f7379521e7e54dae6b1f94",
      "new_mode": 33188,
      "new_path": "arch/powerpc/platforms/pseries/setup.c"
    },
    {
      "type": "modify",
      "old_id": "a6141f05c91973348e4dfc7ec6f163bca2863fbd",
      "old_mode": 33188,
      "old_path": "arch/ppc/kernel/idle.c",
      "new_id": "3c4e4cb610743e070d7237ed7df5fff2fa67c75e",
      "new_mode": 33188,
      "new_path": "arch/ppc/kernel/idle.c"
    },
    {
      "type": "modify",
      "old_id": "909ea669af9159a3dd3341f69a623118e0693529",
      "old_mode": 33188,
      "old_path": "arch/ppc64/kernel/idle.c",
      "new_id": "715bc0e71e0f4dbc45327ce08a59a5a1ab58a335",
      "new_mode": 33188,
      "new_path": "arch/ppc64/kernel/idle.c"
    },
    {
      "type": "modify",
      "old_id": "66ca5757e3686c7c837d7a415acaebe0f4266f06",
      "old_mode": 33188,
      "old_path": "arch/s390/kernel/process.c",
      "new_id": "78b64fe5e7c236ddaf53aba506bd44ea8c59f579",
      "new_mode": 33188,
      "new_path": "arch/s390/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "1cbc26b796ad1ac66f58d86ec972a35006c75ae3",
      "old_mode": 33188,
      "old_path": "arch/sh/kernel/process.c",
      "new_id": "fd4f240b833d5fc55af05e6de0520eaf9847d248",
      "new_mode": 33188,
      "new_path": "arch/sh/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "0c09537449b3a68cfdb8935e619c6c89213c4119",
      "old_mode": 33188,
      "old_path": "arch/sh64/kernel/process.c",
      "new_id": "b95d041418554196350b64096a7486e1a7d6a4cb",
      "new_mode": 33188,
      "new_path": "arch/sh64/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "c39f4d01096d7cac71d22c39981152ede994ebb4",
      "old_mode": 33188,
      "old_path": "arch/sparc/kernel/process.c",
      "new_id": "ea86474114627f267d739def93a6c33d2b4c9c4d",
      "new_mode": 33188,
      "new_path": "arch/sparc/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "2f89206e008f86e7f1b53f665d115e31cc194fd2",
      "old_mode": 33188,
      "old_path": "arch/sparc64/kernel/process.c",
      "new_id": "02f9dec1d459d79731a8d32658db102940cce2cc",
      "new_mode": 33188,
      "new_path": "arch/sparc64/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "8aca4b1dc04e96964f398188e507de2cff68e3a6",
      "old_mode": 33188,
      "old_path": "arch/sparc64/kernel/smp.c",
      "new_id": "797a65493fb848cc836ca4248171e19149f42bc3",
      "new_mode": 33188,
      "new_path": "arch/sparc64/kernel/smp.c"
    },
    {
      "type": "modify",
      "old_id": "571f9fe490ce19e93f741e1036f33a4b7e8bbb35",
      "old_mode": 33188,
      "old_path": "arch/x86_64/kernel/process.c",
      "new_id": "59be85d9a4bc166284ac102aea770d52c77a69cf",
      "new_mode": 33188,
      "new_path": "arch/x86_64/kernel/process.c"
    },
    {
      "type": "modify",
      "old_id": "161db4acfb91de2d26ddbde096688de93322f93c",
      "old_mode": 33188,
      "old_path": "drivers/acpi/processor_idle.c",
      "new_id": "573b6a97bb1f9276f79ad3090c67027047a7549b",
      "new_mode": 33188,
      "new_path": "drivers/acpi/processor_idle.c"
    },
    {
      "type": "modify",
      "old_id": "0f2def822296cae1dfc2eb9710b6b05e3c07a3d9",
      "old_mode": 33188,
      "old_path": "kernel/sched.c",
      "new_id": "ac3f5cc3bb51f725bbf5b8eae5db83516a3c9dee",
      "new_mode": 33188,
      "new_path": "kernel/sched.c"
    }
  ]
}
