Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756540Ab0H3SR3 (ORCPT ); Mon, 30 Aug 2010 14:17:29 -0400 Received: from mga01.intel.com ([192.55.52.88]:24712 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756372Ab0H3SR2 (ORCPT ); Mon, 30 Aug 2010 14:17:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.56,294,1280732400"; d="c'?scan'208";a="833242129" From: "Luck, Tony" To: Hedi Berriche CC: Petr Tesarik , "linux-ia64@vger.kernel.org" , "linux-kernel@vger.kernel.org" Date: Mon, 30 Aug 2010 11:17:25 -0700 Subject: RE: Serious problem with ticket spinlocks on ia64 Thread-Topic: Serious problem with ticket spinlocks on ia64 Thread-Index: ActGSAkqvQ6PUp1nT9SemA+ns7S8DAAI/QoQAIBhiOA= Message-ID: <987664A83D2D224EAE907B061CE93D53015D9B14DC@orsmsx505.amr.corp.intel.com> References: <201008271537.35709.ptesarik@suse.cz> <201008272303.34228.ptesarik@suse.cz> <987664A83D2D224EAE907B061CE93D53015D91D45F@orsmsx505.amr.corp.intel.com> <201008280013.19941.ptesarik@suse.cz> <987664A83D2D224EAE907B061CE93D53015D91D604@orsmsx505.amr.corp.intel.com> <987664A83D2D224EAE907B061CE93D53015D91D645@orsmsx505.amr.corp.intel.com> <20100828002855.GI18967@zorg.emea.sgi.com> <987664A83D2D224EAE907B061CE93D53015D91D6F5@orsmsx505.amr.corp.intel.com> In-Reply-To: <987664A83D2D224EAE907B061CE93D53015D91D6F5@orsmsx505.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/mixed; boundary="_002_987664A83D2D224EAE907B061CE93D53015D9B14DCorsmsx505amrc_" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 18381 Lines: 262 --_002_987664A83D2D224EAE907B061CE93D53015D9B14DCorsmsx505amrc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > I may tinker with this test a bit to include some short random > amounts of hold-time for the lock, and delays between attempts > to acquire it (to make it look more like a contended kernel lock > and less like a continuous queue of processes trading around a > lock that is never free I've been iterating ... adding new bits to try to reproduce the kernel environment: 1) Added delays (bigger delay not holding the lock than holding it - so contention is controlled) 2) Check that locking actually works (with a critzone element that is only modified when the lock is held). 3) Sometimes use trylock (all the odd numbered threads do this). Compile with -frename-registers ... and add a nop() { } function in another file (just to make sure the compiler doesn't optimize the delay loops). Sadly ... my user mode experiments haven't yet yielded any cases where the ticket locks fail in the way that Petr saw them mess up inside the kernel. This latest version has been running for ~90 minutes and has completed 25 million lock/trylock iterations (with about a third of the ticket lock wraparounds passing through the uncontested case (lock =3D=3D 0) and the rest happening with some processes waiting for the lock. So now I'm trying to think of other ways that the kernel case differs from my user mode mock-up. -Tony --_002_987664A83D2D224EAE907B061CE93D53015D9B14DCorsmsx505amrc_ Content-Type: text/plain; name="spinwrap.c" Content-Description: spinwrap.c Content-Disposition: attachment; filename="spinwrap.c"; size=12024; creation-date="Mon, 30 Aug 2010 11:02:12 GMT"; modification-date="Mon, 30 Aug 2010 11:02:12 GMT" Content-Transfer-Encoding: base64 dHlwZWRlZiBzdHJ1Y3QgewogICAgICAgIHZvbGF0aWxlIHVuc2lnbmVkIGludCBsb2NrOwp9IGFy Y2hfc3BpbmxvY2tfdDsKCiNkZWZpbmUgV09SS0VSUyAxNgppbnQgd29ya2VycyA9IFdPUktFUlM7 CgpzdHJ1Y3Qgc2ggewoJYXJjaF9zcGlubG9ja190CWw7IGNoYXIgcGFkMVs2MF07Cglsb25nIHN1 Y2Nlc3M7IGNoYXIgcGFkMls1Nl07Cgl1bnNpZ25lZCBsb25nIGNyaXR6b25lOyBjaGFyIHBhZDNb NTZdOwoJdW5zaWduZWQgbG9uZyBydW5uaW5nOyBjaGFyIHBhZDRbNTZdOwoJbG9uZyB3b3JrZXJb V09SS0VSU107CglpbnQgd3JhcHNbV09SS0VSU107Cn0gKnM7CgppbnQgbWU7CgovKiBjdXQgJiBw YXN0ZSBpbmZyYXN0cnVjdHVyZSBmcm9tIGtlcm5lbCBzdGFydCBoZXJlICovCnR5cGVkZWYgdW5z aWduZWQgbG9uZyBfX3U2NDsKdHlwZWRlZiB1bnNpZ25lZCBpbnQgX191MzI7CnR5cGVkZWYgdW5z aWduZWQgc2hvcnQgX191MTY7CnR5cGVkZWYgdW5zaWduZWQgY2hhciBfX3U4OwojZGVmaW5lIF9f YWx3YXlzX2lubGluZSBpbmxpbmUgX19hdHRyaWJ1dGVfXygoYWx3YXlzX2lubGluZSkpCiNkZWZp bmUgQUNDRVNTX09OQ0UoeCkgKCoodm9sYXRpbGUgdHlwZW9mKHgpICopJih4KSkKCmV4dGVybiB1 bnNpZ25lZCBsb25nIF9fYmFkX3NpemVfZm9yX2lhNjRfZmV0Y2hfYW5kX2FkZCAodm9pZCk7CmV4 dGVybiB1bnNpZ25lZCBsb25nIF9fYmFkX2luY3JlbWVudF9mb3JfaWE2NF9mZXRjaF9hbmRfYWRk ICh2b2lkKTsKCiNkZWZpbmUgaWE2NF9pbnZhbGEoKSBhc20gdm9sYXRpbGUgKCJpbnZhbGEiIDo6 OiAibWVtb3J5IikKCiNkZWZpbmUgaWE2NF9oaW50X3BhdXNlIDAKCiNkZWZpbmUgaWE2NF9oaW50 KG1vZGUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCih7ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc CiAgICAgICAgc3dpdGNoIChtb2RlKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBcCiAgICAgICAgY2FzZSBpYTY0X2hpbnRfcGF1c2U6ICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBcCiAgICAgICAgICAgICAgICBhc20gdm9sYXRpbGUgKCJoaW50IEBw YXVzZSIgOjo6ICJtZW1vcnkiKTsgICAgICBcCiAgICAgICAgICAgICAgICBicmVhazsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgfSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCn0pCiNkZWZpbmUg Y3B1X3JlbGF4KCkgaWE2NF9oaW50KGlhNjRfaGludF9wYXVzZSkKCiNkZWZpbmUgaWE2NF9mZXRj aGFkZDRfYWNxKHAsIGluYykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgXAooeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc CiAgICAgICAgX191NjQgaWE2NF9pbnRyaV9yZXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIGFzbSB2b2xhdGlsZSAoImZldGNoYWRk NC5hY3EgJTA9WyUxXSwlMiIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6ICI9ciIoaWE2NF9pbnRyaV9yZXMpIDogInIiKHAp LCAiaSIgKGluYykgICAgICBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAibWVt b3J5Iik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFwKICAgICAgICBpYTY0X2ludHJpX3JlczsgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCn0pCgojZGVmaW5lIElBNjRfRkVU Q0hBREQodG1wLHYsbixzeixzZW0pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFwKKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgc3dpdGNoIChzeikgeyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg XAogICAgICAgICAgICAgIGNhc2UgNDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgIHRtcCA9IGlhNjRfZmV0 Y2hhZGQ0XyMjc2VtKCh1bnNpZ25lZCBpbnQgKikgdiwgbik7ICAgICAgICAgICAgICBcCiAgICAg ICAgICAgICAgICBicmVhazsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAg ICBjYXNlIDg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCiAgICAgICAgICAgICAgICB0bXAgPSBpYTY0X2ZldGNoYWRkOF8jI3NlbSgo dW5zaWduZWQgbG9uZyAqKSB2LCBuKTsgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgYnJl YWs7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgICAgICAgZGVmYXVsdDogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAog ICAgICAgICAgICAgICAgX19iYWRfc2l6ZV9mb3JfaWE2NF9mZXRjaF9hbmRfYWRkKCk7ICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCn0pCgojZGVm aW5lIGlhNjRfZmV0Y2hhZGQoaSx2LHNlbSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAooeyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgXAogICAgICAgIF9fdTY0IF90bXA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIHZvbGF0aWxlIF9f dHlwZW9mX18oKih2KSkgKl92ID0gKHYpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgXAogICAgICAgIC8qIENhbid0IHVzZSBhIHN3aXRjaCAoKSBoZXJlOiBnY2Mg aXNuJ3QgYWx3YXlzIHNtYXJ0IGVub3VnaCBmb3IgdGhhdC4uLiAqLyAgICAgXAogICAgICAgIGlm ICgoaSkgPT0gLTE2KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgSUE2NF9GRVRDSEFERChfdG1w LCBfdiwgLTE2LCBzaXplb2YoKih2KSksIHNlbSk7ICAgICAgICAgICAgICAgICAgICAgICAgXAog ICAgICAgIGVsc2UgaWYgKChpKSA9PSAtOCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgSUE2NF9GRVRD SEFERChfdG1wLCBfdiwgLTgsIHNpemVvZigqKHYpKSwgc2VtKTsgICAgICAgICAgICAgICAgICAg ICAgICAgXAogICAgICAgIGVsc2UgaWYgKChpKSA9PSAtNCkgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAg SUE2NF9GRVRDSEFERChfdG1wLCBfdiwgLTQsIHNpemVvZigqKHYpKSwgc2VtKTsgICAgICAgICAg ICAgICAgICAgICAgICAgXAogICAgICAgIGVsc2UgaWYgKChpKSA9PSAtMSkgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAg ICAgICAgICAgSUE2NF9GRVRDSEFERChfdG1wLCBfdiwgLTEsIHNpemVvZigqKHYpKSwgc2VtKTsg ICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIGVsc2UgaWYgKChpKSA9PSAxKSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg XAogICAgICAgICAgICAgICAgSUE2NF9GRVRDSEFERChfdG1wLCBfdiwgMSwgc2l6ZW9mKCoodikp LCBzZW0pOyAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIGVsc2UgaWYgKChpKSA9 PSA0KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXAogICAgICAgICAgICAgICAgSUE2NF9GRVRDSEFERChfdG1wLCBfdiwgNCwgc2l6 ZW9mKCoodikpLCBzZW0pOyAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIGVsc2Ug aWYgKChpKSA9PSA4KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgSUE2NF9GRVRDSEFERChfdG1wLCBf diwgOCwgc2l6ZW9mKCoodikpLCBzZW0pOyAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAg ICAgIGVsc2UgaWYgKChpKSA9PSAxNikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgSUE2NF9GRVRDSEFE RChfdG1wLCBfdiwgMTYsIHNpemVvZigqKHYpKSwgc2VtKTsgICAgICAgICAgICAgICAgICAgICAg ICAgXAogICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgX3Rt cCA9IF9fYmFkX2luY3JlbWVudF9mb3JfaWE2NF9mZXRjaF9hbmRfYWRkKCk7ICAgICAgICAgICAg ICAgICAgICAgICAgXAogICAgICAgIChfX3R5cGVvZl9fKCoodikpKSAoX3RtcCk7ICAgICAgLyog cmV0dXJuIG9sZCB2YWx1ZSAqLyAgICAgICAgICAgICAgICAgICAgICAgICAgXAp9KQoKI2RlZmlu ZSBpYTY0X2NtcHhjaGc0X2FjcShwdHIsIG5ldywgb2xkKSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFwKKHsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFwKICAgICAgICBfX3U2NCBpYTY0X2ludHJpX3JlczsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICBhc20gdm9sYXRpbGUg KCJtb3YgYXIuY2N2PSUwOzsiIDo6ICJyTyIob2xkKSk7ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFwKICAgICAgICBhc20gdm9sYXRpbGUgKCJjbXB4Y2hnNC5hY3EgJTA9WyUxXSwl Mixhci5jY3YiOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIj1yIihpYTY0X2ludHJpX3JlcykgOiAiciIocHRyKSwgInIiKG5l dykgOiAibWVtb3J5Iik7ICAgIFwKICAgICAgICBpYTY0X2ludHJpX3JlczsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKfSkK Ci8qCiAqIFRoaXMgZnVuY3Rpb24gZG9lc24ndCBleGlzdCwgc28geW91J2xsIGdldCBhIGxpbmtl ciBlcnJvcgogKiBpZiBzb21ldGhpbmcgdHJpZXMgdG8gZG8gYW4gaW52YWxpZCBjbXB4Y2hnKCku CiAqLwpleHRlcm4gbG9uZyBpYTY0X2NtcHhjaGdfY2FsbGVkX3dpdGhfYmFkX3BvaW50ZXIgKHZv aWQpOwoKI2RlZmluZSBpYTY0X2NtcHhjaGcoc2VtLHB0cixvbGQsbmV3LHNpemUpICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKHsgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFwKICAgICAgICBfX3U2NCBfb18sIF9yXzsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICBzd2l0Y2ggKHNpemUpIHsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwK ICAgICAgICAgICAgICBjYXNlIDE6IF9vXyA9IChfX3U4ICkgKGxvbmcpIChvbGQpOyBicmVhazsg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICBjYXNlIDI6IF9v XyA9IChfX3UxNikgKGxvbmcpIChvbGQpOyBicmVhazsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFwKICAgICAgICAgICAgICBjYXNlIDQ6IF9vXyA9IChfX3UzMikgKGxvbmcpIChvbGQp OyBicmVhazsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICBj YXNlIDg6IF9vXyA9IChfX3U2NCkgKGxvbmcpIChvbGQpOyBicmVhazsgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICBkZWZhdWx0OiBicmVhazsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAg ICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICBzd2l0Y2ggKHNpemUpIHsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFwKICAgICAgICAgICAgICBjYXNlIDE6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgIF9yXyA9 IGlhNjRfY21weGNoZzFfIyNzZW0oKF9fdTggKikgcHRyLCBuZXcsIF9vXyk7ICAgICAgICAgICAg ICAgICAgICAgIFwKICAgICAgICAgICAgICAgIGJyZWFrOyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICBjYXNlIDI6ICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAg ICAgICAgICAgICAgX3JfID0gaWE2NF9jbXB4Y2hnMl8jI3NlbSgoX191MTYgKikgcHRyLCBuZXcs IF9vXyk7ICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgIGJyZWFrOyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICBjYXNl IDQ6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgIF9yXyA9IGlhNjRfY21weGNoZzRfIyNzZW0o KF9fdTMyICopIHB0ciwgbmV3LCBfb18pOyAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAg ICAgICAgIGJyZWFrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwK ICAgICAgICAgICAgICBjYXNlIDg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgIF9yXyA9IGlh NjRfY21weGNoZzhfIyNzZW0oKF9fdTY0ICopIHB0ciwgbmV3LCBfb18pOyAgICAgICAgICAgICAg ICAgICAgIFwKICAgICAgICAgICAgICAgIGJyZWFrOyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICBkZWZhdWx0OiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAg ICAgICAgICAgIF9yXyA9IGlhNjRfY21weGNoZ19jYWxsZWRfd2l0aF9iYWRfcG9pbnRlcigpOyAg ICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAgICAgICAgIGJyZWFrOyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFwKICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICAgICAoX190eXBlb2ZfXyhv bGQpKSBfcl87ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFwKfSkKCiNkZWZpbmUgVElDS0VUX1NISUZUICAgIDE3IC8qd2FzMTcqLwojZGVm aW5lIFRJQ0tFVF9CSVRTICAgICAxNSAvKndhczE1Ki8KI2RlZmluZSBUSUNLRVRfTUFTSyAgICAg KCgxIDw8IFRJQ0tFVF9CSVRTKSAtIDEpCgpzdGF0aWMgX19hbHdheXNfaW5saW5lIHZvaWQgX190 aWNrZXRfc3Bpbl9sb2NrKGFyY2hfc3BpbmxvY2tfdCAqbG9jaykKewogICAgICAgIGludCAgICAg KnAgPSAoaW50ICopJmxvY2stPmxvY2ssIHRpY2tldCwgc2VydmU7CgogICAgICAgIHRpY2tldCA9 IGlhNjRfZmV0Y2hhZGQoMSwgcCwgYWNxKTsKCmlmICh0aWNrZXQgPT0gMCkgcy0+d3JhcHNbbWVd Kys7CgogICAgICAgIGlmICghKCgodGlja2V0ID4+IFRJQ0tFVF9TSElGVCkgXiB0aWNrZXQpICYg VElDS0VUX01BU0spKQogICAgICAgICAgICAgICAgcmV0dXJuOwoKICAgICAgICBpYTY0X2ludmFs YSgpOwoKICAgICAgICBmb3IgKDs7KSB7CiAgICAgICAgICAgICAgICBhc20gdm9sYXRpbGUgKCJs ZDQuYy5uYyAlMD1bJTFdIiA6ICI9ciIoc2VydmUpIDogInIiKHApIDogIm1lbW9yeSIpOwoKICAg ICAgICAgICAgICAgIGlmICghKCgoc2VydmUgPj4gVElDS0VUX1NISUZUKSBeIHRpY2tldCkgJiBU SUNLRVRfTUFTSykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwoJCX0KICAgICAg ICAgICAgICAgIGNwdV9yZWxheCgpOwogICAgICAgIH0KfQoKc3RhdGljIF9fYWx3YXlzX2lubGlu ZSBpbnQgX190aWNrZXRfc3Bpbl90cnlsb2NrKGFyY2hfc3BpbmxvY2tfdCAqbG9jaykKewogICAg ICAgIGludCB0bXAgPSBBQ0NFU1NfT05DRShsb2NrLT5sb2NrKTsKCmlmICh0bXAgPT0gMCkgcy0+ d3JhcHNbbWVdKys7CiAgICAgICAgaWYgKCEoKCh0bXAgPj4gVElDS0VUX1NISUZUKSBeIHRtcCkg JiBUSUNLRVRfTUFTSykpCiAgICAgICAgICAgICAgICByZXR1cm4gaWE2NF9jbXB4Y2hnKGFjcSwg JmxvY2stPmxvY2ssIHRtcCwgdG1wICsgMSwgc2l6ZW9mICh0bXApKSA9PSB0bXA7CiAgICAgICAg cmV0dXJuIDA7Cn0KCnN0YXRpYyBfX2Fsd2F5c19pbmxpbmUgdm9pZCBfX3RpY2tldF9zcGluX3Vu bG9jayhhcmN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gkJcHJpbnRmKCIlbGQgW2xvY2sgPSAlLjh4XVxuIiwgcy0+ c3VjY2Vzcywgcy0+bC5sb2NrKTsKCQlmb3IgKGkgPSAwOyBpIDwgd29ya2VyczsgaSsrKQoJCQlw cmludGYoIiAlbGQgJS44eFxuIiwgcy0+d29ya2VyW2ldLCBzLT53cmFwc1tpXSk7Cgl9Cn0K --_002_987664A83D2D224EAE907B061CE93D53015D9B14DCorsmsx505amrc_-- -- 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/