Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/252/?format=api
{ "id": 252, "url": "http://patchwork.ozlabs.org/api/patches/252/?format=api", "web_url": "http://patchwork.ozlabs.org/project/cbe-oss-dev/patch/200809112038.11711.adetsch@br.ibm.com/", "project": { "id": 1, "url": "http://patchwork.ozlabs.org/api/projects/1/?format=api", "name": "Cell Broadband Engine development", "link_name": "cbe-oss-dev", "list_id": "cbe-oss-dev.ozlabs.org", "list_email": "cbe-oss-dev@ozlabs.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<200809112038.11711.adetsch@br.ibm.com>", "list_archive_url": null, "date": "2008-09-11T23:38:11", "name": "powerpc/spufs: Gang should yield its spu(s) on major page", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ab45e9afe145045d5a9be49a26d8d606d37c695a", "submitter": { "id": 93, "url": "http://patchwork.ozlabs.org/api/people/93/?format=api", "name": "Andre Detsch", "email": "adetsch@br.ibm.com" }, "delegate": { "id": 1, "url": "http://patchwork.ozlabs.org/api/users/1/?format=api", "username": "jk", "first_name": "Jeremy", "last_name": "Kerr", "email": "jk@ozlabs.org" }, "mbox": "http://patchwork.ozlabs.org/project/cbe-oss-dev/patch/200809112038.11711.adetsch@br.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/252/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/252/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<cbe-oss-dev-bounces+patchwork=ozlabs.org@ozlabs.org>", "X-Original-To": [ "patchwork@ozlabs.org", "cbe-oss-dev@ozlabs.org" ], "Delivered-To": [ "patchwork@ozlabs.org", "cbe-oss-dev@ozlabs.org" ], "Received": [ "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id 95519DE132\n\tfor <patchwork@ozlabs.org>; Fri, 12 Sep 2008 09:39:50 +1000 (EST)", "from igw2.br.ibm.com (igw2.br.ibm.com [32.104.18.25])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client CN \"mailgw2.br.ibm.com\", Issuer \"Equifax\" (not verified))\n\tby ozlabs.org (Postfix) with ESMTPS id E5546DE007;\n\tFri, 12 Sep 2008 09:38:59 +1000 (EST)", "from mailhub1.br.ibm.com (mailhub1 [9.18.232.109])\n\tby igw2.br.ibm.com (Postfix) with ESMTP id 78F1417F429;\n\tThu, 11 Sep 2008 20:23:42 -0300 (BRT)", "from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47])\n\tby mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id\n\tm8BNd0XX2183430; Thu, 11 Sep 2008 20:39:00 -0300", "from d24av02.br.ibm.com (loopback [127.0.0.1])\n\tby d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id\n\tm8BNcrYS030017; Thu, 11 Sep 2008 20:38:53 -0300", "from [9.8.10.86] ([9.8.10.86])\n\tby d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id\n\tm8BNcqVr030009; Thu, 11 Sep 2008 20:38:53 -0300" ], "From": "Andre Detsch <adetsch@br.ibm.com>", "To": "cbe-oss-dev@ozlabs.org", "Date": "Thu, 11 Sep 2008 20:38:11 -0300", "User-Agent": "KMail/1.9.6", "References": "<200809111955.28780.adetsch@br.ibm.com>", "In-Reply-To": "<200809111955.28780.adetsch@br.ibm.com>", "MIME-Version": "1.0", "Content-Disposition": "inline", "Message-Id": "<200809112038.11711.adetsch@br.ibm.com>", "Cc": "LukeBrowning@us.ibm.com, Jeremy Kerr <jk@ozlabs.org>", "Subject": "[Cbe-oss-dev] [PATCH 05/11] powerpc/spufs: Gang should yield its\n\tspu(s) on major page", "X-BeenThere": "cbe-oss-dev@ozlabs.org", "X-Mailman-Version": "2.1.11", "Precedence": "list", "List-Id": "Discussion about Open Source Software for the Cell Broadband Engine\n\t<cbe-oss-dev.ozlabs.org>", "List-Unsubscribe": "<https://ozlabs.org/mailman/options/cbe-oss-dev>,\n\t<mailto:cbe-oss-dev-request@ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://ozlabs.org/pipermail/cbe-oss-dev>", "List-Post": "<mailto:cbe-oss-dev@ozlabs.org>", "List-Help": "<mailto:cbe-oss-dev-request@ozlabs.org?subject=help>", "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/cbe-oss-dev>,\n\t<mailto:cbe-oss-dev-request@ozlabs.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "cbe-oss-dev-bounces+patchwork=ozlabs.org@ozlabs.org", "Errors-To": "cbe-oss-dev-bounces+patchwork=ozlabs.org@ozlabs.org" }, "content": "Implement gang level nfaulting count that is incremented and decremented\nacross major page faults enabling the gang to be yielded when there are\nno runnable contexts in the gang. If there are no other runnable gangs\nwaiting to be dispatched, then the gang remains lazily loaded. Otherwise,\nit is switched out and put on the rq. The nrunnable count is the number\nof contexts in the gang that are inside spu_run() and are considered\nrunnable.\n\nSigned-off-by: Luke Browning <lukebrowning@us.ibm.com>\nSigned-off-by: Andre Detsch <adetsch@br.ibm.com>", "diff": "diff --git a/arch/powerpc/platforms/cell/spufs/fault.c \nb/arch/powerpc/platforms/cell/spufs/fault.c\nindex f093a58..9e270b9 100644\n--- a/arch/powerpc/platforms/cell/spufs/fault.c\n+++ b/arch/powerpc/platforms/cell/spufs/fault.c\n@@ -149,8 +149,16 @@ int spufs_handle_class1(struct spu_context *ctx)\n \tlocal_irq_restore(flags);\n \n \t/* hashing failed, so try the actual fault handler */\n-\tif (ret)\n+\tif (ret) {\n+\t\tstruct spu_gang *gang = ctx->gang;\n+\n+\t\tatomic_inc(&gang->nfaulting);\n+\t\tif (atomic_read(&gang->nrunnable) ==\n+\t\t atomic_read(&gang->nfaulting))\n+\t\t\tspu_yield(ctx);\n \t\tret = spu_handle_mm_fault(current->mm, ea, dsisr, &flt);\n+\t\tatomic_dec(&gang->nfaulting);\n+\t}\n \n \t/*\n \t * This is nasty: we need the state_mutex for all the bookkeeping even\n@@ -166,8 +174,7 @@ int spufs_handle_class1(struct spu_context *ctx)\n \tctx->csa.class_1_dar = ctx->csa.class_1_dsisr = 0;\n \n \t/*\n-\t * If we handled the fault successfully and are in runnable\n-\t * state, restart the DMA.\n+\t * If we handled the fault successfully, restart the DMA.\n \t * In case of unhandled error report the problem to user space.\n \t */\n \tif (!ret) {\ndiff --git a/arch/powerpc/platforms/cell/spufs/spufs.h \nb/arch/powerpc/platforms/cell/spufs/spufs.h\nindex f7d3e96..bc3b499 100644\n--- a/arch/powerpc/platforms/cell/spufs/spufs.h\n+++ b/arch/powerpc/platforms/cell/spufs/spufs.h\n@@ -168,6 +168,7 @@ struct spu_gang {\n \tint prio;\n \tatomic_t nstarted;\n \tatomic_t nrunnable;\n+\tatomic_t nfaulting;\n \tunsigned long sched_flags;\n \tstruct list_head rq;\n \n", "prefixes": [] }