Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753516AbXFZBqt (ORCPT ); Mon, 25 Jun 2007 21:46:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751382AbXFZBql (ORCPT ); Mon, 25 Jun 2007 21:46:41 -0400 Received: from an-out-0708.google.com ([209.85.132.247]:42038 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751329AbXFZBqk (ORCPT ); Mon, 25 Jun 2007 21:46:40 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=SJZNkMzu+Ky2dKIn8Gu1QpP5xTiznAFLK7AEfZdiBygizHwZWTtN7bct9A15THSewDX3JYJhlfdcdVwmiTrArVMaZeDmvtFlcFCs/+DwM9QhmCklXngnjC1X5txtuTeSspbz6ZqHxM+IsAuwkuip4yh0mjTmCg7t497J8jKbPCE= Message-ID: Date: Mon, 25 Jun 2007 18:46:39 -0700 From: "Dan Williams" To: "Ingo Molnar" Subject: Re: [RFC PATCH 0/6] Convert all tasklets to workqueues Cc: "Linus Torvalds" , "Steven Rostedt" , LKML , "Andrew Morton" , "Thomas Gleixner" , "Christoph Hellwig" , "john stultz" , "Oleg Nesterov" , "Paul E. McKenney" , "Dipankar Sarma" , "David S. Miller" , matthew.wilcox@hp.com, kuznet@ms2.inr.ac.ru In-Reply-To: <20070622215953.GA22917@elte.hu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_15972_20500424.1182822399594" References: <20070622040014.234651401@goodmis.org> <20070622204058.GA11777@elte.hu> <20070622215953.GA22917@elte.hu> X-Google-Sender-Auth: d4c514fd01c4582b Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6847 Lines: 109 ------=_Part_15972_20500424.1182822399594 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline > so how about the following, different approach: anyone who has a tasklet > in any performance-sensitive codepath, please yell now. We'll also do a > proactive search for such places. We can convert those places to > softirqs, or move them back into hardirq context. Once this is done - > and i doubt it will go beyond 1-2 places - we can just mass-convert the > other 110 places to the lame but compatible solution of doing them in a > global thread context. > I have a driver / testcase that reacts negatively to a workqueue conversion. This is with the iop-adma driver on an ARM based platform re-syncing a degraded raid5 array. The driver is currently in -mm and it uses tasklets to run a short callback routine upon completion of an offloaded memcpy or xor operation. Quick tests show that write-throughput does not go down too much, but resync speed, as reported by /proc/mdstat, drops from ~50MB/s to ~30MB/s. Context switches on this platform flush the L1 cache so bouncing between a workqueue and the MD thread is painful. The conversion patch is attached. -- Dan ------=_Part_15972_20500424.1182822399594 Content-Type: text/x-patch; name=iop-adma-workq-conv.patch; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_f3dpuj5t Content-Disposition: attachment; filename="iop-adma-workq-conv.patch" ZGlmZiAtLWdpdCBhL2RyaXZlcnMvZG1hL2lvcC1hZG1hLmMgYi9kcml2ZXJzL2RtYS9pb3AtYWRt YS5jCmluZGV4IDVkOGE2Y2YuLjdlODkwMDMgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvZG1hL2lvcC1h ZG1hLmMKKysrIGIvZHJpdmVycy9kbWEvaW9wLWFkbWEuYwpAQCAtNDEsNiArNDEsOCBAQAogI2Rl ZmluZSB0eF90b19pb3BfYWRtYV9zbG90KHR4KSBcCiAJY29udGFpbmVyX29mKHR4LCBzdHJ1Y3Qg aW9wX2FkbWFfZGVzY19zbG90LCBhc3luY190eCkKIAorc3RhdGljIHN0cnVjdCB3b3JrcXVldWVf c3RydWN0ICppb3BfYWRtYV93b3JrcXVldWU7CisKIC8qKgogICogaW9wX2FkbWFfZnJlZV9zbG90 cyAtIGZsYWdzIGRlc2NyaXB0b3Igc2xvdHMgZm9yIHJldXNlCiAgKiBAc2xvdDogU2x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fYWRtYV9jaGFuIHsKIAlzdHJ1Y3QgbGlzdF9oZWFk IGFsbF9zbG90czsKIAlzdHJ1Y3QgdGltZXJfbGlzdCBjbGVhbnVwX3dhdGNoZG9nOwogCWludCBz bG90c19hbGxvY2F0ZWQ7Ci0Jc3RydWN0IHRhc2tsZXRfc3RydWN0IGlycV90YXNrbGV0OworCXN0 cnVjdCB3b3JrX3N0cnVjdCB3b3JrOwogfTsKIAogLyoqCg== ------=_Part_15972_20500424.1182822399594-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/