Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422659Ab2JLJHv (ORCPT ); Fri, 12 Oct 2012 05:07:51 -0400 Received: from mga01.intel.com ([192.55.52.88]:62615 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932421Ab2JLJHr (ORCPT ); Fri, 12 Oct 2012 05:07:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,576,1344236400"; d="c'?scan'208";a="233102236" From: "Ma, Ling" To: Borislav Petkov CC: Konrad Rzeszutek Wilk , "mingo@elte.hu" , "hpa@zytor.com" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "iant@google.com" Subject: RE: [PATCH RFC 2/2] [x86] Optimize copy_page by re-arranging instruction sequence and saving register Thread-Topic: [PATCH RFC 2/2] [x86] Optimize copy_page by re-arranging instruction sequence and saving register Thread-Index: AQHNp3KHe7EK2OTz7EWBVGWon0YSZpezpk8AgAFdKsD//6o9gIAAnmeA Date: Fri, 12 Oct 2012 09:07:43 +0000 Message-ID: References: <1349958548-1868-1-git-send-email-ling.ma@intel.com> <20121011143527.GA2408@localhost.localdomain> <20121012061813.GC9881@liondog.tnic> In-Reply-To: <20121012061813.GC9881@liondog.tnic> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: multipart/mixed; boundary="_002_B2310DA9850C8743AA7AA0055500E90F0FD70AC5SHSMSX102ccrcor_" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9970 Lines: 140 --_002_B2310DA9850C8743AA7AA0055500E90F0FD70AC5SHSMSX102ccrcor_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 PiA+ID4gU28gaXMgdGhhdCBhbHNvIHRydWUgZm9yIEFNRCBDUFVzPw0KPiA+IEFsdGhvdWdoIEJ1 bGxk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content-Type: text/plain; name="copy_page.c" Content-Description: copy_page.c Content-Disposition: attachment; filename="copy_page.c"; size=5975; creation-date="Fri, 12 Oct 2012 07:52:33 GMT"; modification-date="Fri, 12 Oct 2012 09:00:39 GMT" Content-Transfer-Encoding: base64 I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgoKCnR5cGVkZWYgdW5zaWduZWQg bG9uZyBsb25nIGludCBocF90aW1pbmdfdDsKI2RlZmluZSAgTUFYU0FNUExFU1RQVCAgICAgICAg MTAwMAojZGVmaW5lICBNQVhDT1BZU0laRSAgICAgICAgICAoMTAyNCAqIDEwMjQpCiNkZWZpbmUg IE9SSUcgIDAKI2RlZmluZSAgTkVXICAgMQpzdGF0aWMgY2hhciogYnVmMSA9IE5VTEw7CnN0YXRp YyBjaGFyKiBidWYyID0gTlVMTDsKc3RhdGljIGludCByZXBlYXRfb25lX3Rlc3QgPSAzMjsKCmhw X3RpbWluZ190IF9kbF9ocF90aW1pbmdfb3ZlcmhlYWQ7CiMgZGVmaW5lIEhQX1RJTUlOR19OT1co VmFyKSBcCiAgKHsgdW5zaWduZWQgbG9uZyBsb25nIF9oaSwgX2xvOyBcCiAgICAgYXNtIHZvbGF0 aWxlICgicmR0c2MiIDogIj1hIiAoX2xvKSwgIj1kIiAoX2hpKSk7IFwKICAgICAoVmFyKSA9IF9o aSA8PCAzMiB8IF9sbzsgfSkKCiNkZWZpbmUgSFBfVElNSU5HX0RJRkYoRGlmZiwgU3RhcnQsIEVu ZCkJKERpZmYpID0gKChFbmQpIC0gKFN0YXJ0KSkKI2RlZmluZSBIUF9USU1JTkdfVE9UQUwodG90 YWxfdGltZSwgc3RhcnQsIGVuZCkJXAogIGRvCQkJCQkJCQkJXAogICAgewkJCQkJCQkJCVwKICAg ICAgaHBfdGltaW5nX3QgdG1wdGltZTsJCQkJCQlcCiAgICAgIEhQX1RJTUlOR19ESUZGICh0bXB0 aW1lLCBzdGFydCArIF9kbF9ocF90aW1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XJzcCkiKTsKCV9fYXNtX18oIm1vdmwJJCg0MDk2LzY0KS01LCVlY3giKTsKCV9fYXNtX18o Ii5wMmFsaWduIDQiKTsKX19hc21fXygiMToiKTsKCV9fYXNtX18oImRlYyAgICAgJXJjeCIpOwoK CV9fYXNtX18oIm1vdnEgICAgICAgICglcnNpKSwgJXJheCIpOwoJX19hc21fXygibW92cSAgICAg IDggKCVyc2kpLCAlcmJ4Iik7CglfX2FzbV9fKCJtb3ZxICAgICAxNiAoJXJzaSksICVyZHgiKTsK CV9fYXNtX18oIm1vdnEgICAgIDI0ICglcnNpKSwgJXI4Iik7CglfX2FzbV9fKCJtb3ZxICAgICAz MiAoJXJzaSksICVyOSIpOwoJX19hc21fXygibW92cSAgICAgNDAgKCVyc2kpLCAlcjEwIik7Cglf X2FzbV9fKCJtb3ZxICAgICA0OCAoJXJzaSksICVyMTEiKTsKCV9fYXNtX18oIm1vdnEgICAgIDU2 ICglcnNpKSwgJXIxMiIpOwoKCV9fYXNtX18oInByZWZldGNodDAgNSo2NCglcnNpKSIpOwoKCV9f YXNtX18oIm1vdnEgICAgICVyYXgsICAgICglcmRpKSIpOwoJX19hc21fXygibW92cSAgICAgJXJi eCwgIDggKCVyZGkpIik7CglfX2FzbV9fKCJtb3ZxICAgICAlcmR4LCAxNiAoJXJkaSkiKTsKCV9f YXNtX18oIm1vdnEgICAgICVyOCwgIDI0ICglcmRpKSIpOwoJX19hc21fXygibW92cSAgICAgJXI5 LCAgMzIgKCVyZGkpIik7CglfX2FzbV9fKCJtb3ZxICAgICAlcjEwLCA0MCAoJXJkaSkiKTsKCV9f YXNtX18oIm1vdnEgICAgICVyMTEsIDQ4ICglcmRpKSIpOwoJX19hc21fXygibW92cSAgICAgJXIx MiwgNTYgKCVyZGkpIik7CgoJX19hc21fXygibGVhcSAgICA2NCAoJXJzaSksICVyc2kiKTsKCV9f YXNtX18oImxlYXEgICAgNjQgKCVyZGkpLCAlcmRpIik7CglfX2FzbV9fKCJqbnogICAgIDFiIik7 CgoJX19hc21fXygibW92bAkkNSwlZWN4Iik7CglfX2FzbV9fKCIucDJhbGlnbiA0Iik7Cl9fYXNt X18oIjI6Iik7CglfX2FzbV9fKCJkZWNsICAgJWVjeCIpOwoKCV9fYXNtX18oIm1vdnEgICAgICAg ICglcnNpKSwgJXJheCIpOwoJX19hc21fXygibW92cSAgICAgIDggKCVyc2kpLCAlcmJ4Iik7Cglf X2FzbV9fKCJtb3ZxICAgICAxNiAoJXJzaSksICVyZHgiKTsKCV9fYXNtX18oIm1vdnEgICAgIDI0 ICglcnNpKSwgJXI4Iik7CglfX2FzbV9fKCJtb3ZxICAgICAzMiAoJXJzaSksICVyOSIpOwoJX19h c21fXygibW92cSAgICAgNDAgKCVyc2kpLCAlcjEwIik7CglfX2FzbV9fKCJtb3ZxICAgICA0OCAo JXJzaSksICVyMTEiKTsKCV9fYXNtX18oIm1vdnEgICAgIDU2ICglcnNpKSwgJXIxMiIpOwoKCV9f YXNtX18oIm1vdnEgICAgICVyYXgsICAgICglcmRpKSIpOwoJX19hc21fXygibW92cSAgICAgJXJi eCwgIDggKCVyZGkpIik7CglfX2FzbV9fKCJtb3ZxICAgICAlcmR4LCAxNiAoJXJkaSkiKTsKCV9f YXNtX18oIm1vdnEgICAgICVyOCwgIDI0ICglcmRpKSIpOwoJX19hc21fXygibW92cSAgICAgJXI5 LCAgMzIgKCVyZGkpIik7CglfX2FzbV9fKCJtb3ZxICAgICAlcjEwLCA0MCAoJXJkaSkiKTsKCV9f YXNtX18oIm1vdnEgICAgICVyMTEsIDQ4ICglcmRpKSIpOwoJX19hc21fXygibW92cSAgICAgJXIx MiwgNTYgKCVyZGkpIik7CgoJX19hc21fXygibGVhcQk2NCglcmRpKSwlcmRpIik7CglfX2FzbV9f KCJsZWFxCTY0KCVyc2kpLCVyc2kiKTsKCglfX2FzbV9fKCJqbnoJMmIiKTsKCglfX2FzbV9fKCJt b3ZxCSglcnNwKSwlcmJ4Iik7CglfX2FzbV9fKCJtb3ZxCTEqOCglcnNwKSwlcjEyIik7CglfX2Fz bV9fKCJhZGRxCSQyKjgsJXJzcCIpOwp9CgoKdm9pZCBtYWluKHZvaWQpCnsKICBpbnQgaTsKCXRl c3RfaW5pdCgpOwoJcHJpbnRmICgiJTIzcyIsICIiKTsKCXByaW50ZiAoIlx0JXNcdCVzXHQlc1xu IiwgImNvcHlfcGFnZV9vcmciLCAiY29weV9wYWdlX25ldyIpOwoKCWRvX3Rlc3QoMCwgMCwgNDA5 Nik7Cglkb190ZXN0KDAsIDAsIDQwOTYpOwoJZG9fdGVzdCgwLCAwLCA0MDk2KTsKCWRvX3Rlc3Qo MCwgMCwgNDA5Nik7Cglkb190ZXN0KDAsIDAsIDQwOTYpOwoJcmV0dXJuIDsKfQo= --_002_B2310DA9850C8743AA7AA0055500E90F0FD70AC5SHSMSX102ccrcor_-- -- 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/