Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751564AbZLRKMQ (ORCPT ); Fri, 18 Dec 2009 05:12:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751177AbZLRKMN (ORCPT ); Fri, 18 Dec 2009 05:12:13 -0500 Received: from mail-pw0-f42.google.com ([209.85.160.42]:53613 "EHLO mail-pw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750900AbZLRKMJ (ORCPT ); Fri, 18 Dec 2009 05:12:09 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=YcJYPy8lR8j8T89vkJBkFExn7y9VmU7CtfH4a+oH9ggVYtpJo23t2N81qONAsWI2mh 5J8t7196do4Tu9cnDQ4cXnrnfhFZypRy8PmAcURUorLMEOPuyDbsArgftfqzh+8lljY9 JtVtBl9F9faN0ZacM/VRhnTYAlbF1UNZ2Br8M= MIME-Version: 1.0 In-Reply-To: <1261121405.30469.8.camel@marge.simson.net> References: <1261042383.14314.0.camel@localhost> <28f2fcbc0912170242r6d93dfb1j337558a829e21a75@mail.gmail.com> <20091217105316.GB26010@elte.hu> <1261047618.14314.6.camel@localhost> <28f2fcbc0912171718x271520b4k5da3376b5182d88a@mail.gmail.com> <20091218052344.GD417@elte.hu> <1261121405.30469.8.camel@marge.simson.net> From: Jason Garrett-Glaser Date: Fri, 18 Dec 2009 02:11:47 -0800 Message-ID: <28f2fcbc0912180211we599252v39cb94d113537eb5@mail.gmail.com> Subject: Re: x264 benchmarks BFS vs CFS To: Mike Galbraith Cc: Ingo Molnar , Kasper Sandberg , Peter Zijlstra , LKML Mailinglist , Linus Torvalds Content-Type: multipart/mixed; boundary=000e0cd138b0d8bf1e047afdf84e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 21778 Lines: 323 --000e0cd138b0d8bf1e047afdf84e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Dec 17, 2009 at 11:30 PM, Mike Galbraith wrote: > On Fri, 2009-12-18 at 06:23 +0100, Ingo Molnar wrote: > >> Having said that, we generally try to make things perform well without a= pps >> having to switch themselves to SCHED_BATCH. Mike, do you think we can ma= ke >> x264 perform as well (or nearly as well) under SCHED_OTHER as under >> SCHED_BATCH? > > It's not bad as is, except for ultrafast mode. =A0START_DEBIT is the > biggest problem there. =A0I don't think SCHED_OTHER will ever match > SCHED_BATCH for this load, though I must say I haven't full-spectrum > tested. =A0This load really wants RR scheduling, and wakeup preemption > necessarily perturbs run order. > > I'll probably piddle with it some more, it's an interesting load. > > =A0 =A0 =A0 =A0-Mike > > Two more thoughts here: 1) We're considering moving to a thread pool soon; we already have a working patch for it and if anything it'll save a few clocks spent on nice()ing threads and other such things. Will this improve START_DEBIT at all? I've attached the beta patch if you want to try it. Note this also works with 2) as well, so it adds yet another dimension to what's mentioned below. 2) We recently implemented a new threading model which may be interesting to test as well. This threading model gives worse compression *and* performance, but has one benefit: it adds zero latency, whereas normal threading adds a full frame of latency per thread. This was paid for by a company interested in ultra-low-latency streaming applications, where 1 millisecond is a huge deal. I've been thinking this might be interesting to bench from a kernel perspective as well, as when you're spawning a half-dozen threads and need them all done within 6 milliseconds, you start getting down to serious scheduler issues. The new threading model is much less complex than the regular one and works as follows. The frame is split into X slices, and each slice encoded with one thread. Specifically, it works via the following process: 1. Preprocess input frame, perform lookahead analysis on input frame (all singlethreaded) 2. Split up a ton of threads to do the main encode, one per slice. 3. Join all the threads. 4. Do post-filtering on the output frame, return. Clearly this is an utter disaster, since it spawns N times as many threads as the old threading model *and* they last far shorter, *and* only part of the application is multithreaded. But there's not really a better way to do low-latency threading, and it's an interesting challenge to boot. IIRC, it's also the way ffmpeg's encoder threading works. It's widely considered an inferior model, but as mentioned before, in this particular use-case there's no choice. To enable this, use --sliced-threads. I'd recommend using a higher-resolution clip for this, as it performs atrociously bad on very low resolution videos for reasons you might be able to guess. If you need a higher-res clip, check the SD or HD ones here: http://media.xiph.org/video/derf/ . I'm personally curious as to what kind of scheduler issues this results in--I haven't done any BFS vs CFS tests with this option enabled yet. Jason --000e0cd138b0d8bf1e047afdf84e Content-Type: application/octet-stream; name="thread_pool_slices.diff" Content-Disposition: attachment; filename="thread_pool_slices.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g3csuak80 ZGlmZiAtLWdpdCBhL2NvbW1vbi9jb21tb24uaCBiL2NvbW1vbi9jb21tb24uaAppbmRleCA0MTdh YzllLi4yOGQ2YzFkIDEwMDY0NAotLS0gYS9jb21tb24vY29tbW9uLmgKKysrIGIvY29tbW9uL2Nv bW1vbi5oCkBAIC0zMzcsMTIgKzMzNywyMCBAQCBzdHJ1Y3QgeDI2NF90CiAgICAgLyogZW5jb2Rl ciBwYXJhbWV0ZXJzICovCiAgICAgeDI2NF9wYXJhbV90ICAgIHBhcmFtOwogCi0gICAgeDI2NF90 ICAgICAgICAgICp0aHJlYWRbWDI2NF9USFJFQURfTUFYKzFdOwotICAgIHgyNjRfcHRocmVhZF90 ICB0aHJlYWRfaGFuZGxlOwotICAgIGludCAgICAgICAgICAgICBiX3RocmVhZF9hY3RpdmU7Ci0g ICAgaW50ICAgICAgICAgICAgIGlfdGhyZWFkX3BoYXNlOyAvKiB3aGljaCB0aHJlYWQgdG8gdXNl IGZvciB0aGUgbmV4dCBmcmFtZSAqLwotICAgIGludCAgICAgICAgICAgICBpX3RocmVhZHNsaWNl X3N0YXJ0OyAvKiBmaXJzdCByb3cgaW4gdGhpcyB0aHJlYWQgc2xpY2UgKi8KLSAgICBpbnQgICAg ICAgICAgICAgaV90aHJlYWRzbGljZV9lbmQ7IC8qIHJvdyBhZnRlciB0aGUgZW5kIG9mIHRoaXMg dGhyZWFkIHNsaWNlICovCisgICAgeDI2NF90ICAgICAgICAgICAgICAgKnRocmVhZFtYMjY0X1RI UkVBRF9NQVgrMV07IC8qIGNvbnRleHRzIGZvciBlYWNoIGZyYW1lIGluIHByb2dyZXNzICsgbG9v a2FoZWFkICovCisgICAgeDI2NF9wdGhyZWFkX3QgICAgICAgKnRocmVhZF9oYW5kbGU7CisgICAg eDI2NF9wdGhyZWFkX2NvbmRfdCAgdGhyZWFkX3F1ZXVlX2N2OworICAgIHgyNjRfcHRocmVhZF9t dXRleF90IHRocmVhZF9xdWV1ZV9tdXRleDsKKyAgICB4MjY0X3QgICAgICAgICAgICAgICAqKnRo cmVhZF9xdWV1ZTsgLyogZnJhbWVzIHRoYXQgaGF2ZSBiZWVuIHByZXBhcmVkIGJ1dCBub3QgeWV0 IGNsYWltZWQgYnkgYSB3b3JrZXIgdGhyZWFkICovCisgICAgeDI2NF9wdGhyZWFkX2NvbmRfdCAg dGhyZWFkX2FjdGl2ZV9jdjsKKyAgICB4MjY0X3B0aHJlYWRfbXV0ZXhfdCB0aHJlYWRfYWN0aXZl X211dGV4OworICAgIGludCAgICAgICAgICAgICAgICAgIHRocmVhZF9hY3RpdmU7CisgICAgaW50 ICAgICAgICAgICAgICAgICAgYl90aHJlYWRfYWN0aXZlOworICAgIGludCAgICAgICAgICAgICAg ICAgIGlfdGhyZWFkX3BoYXNlOyAvKiB3aGljaCB0aHJlYWQgdG8gdXNlIGZvciB0aGUgbmV4dCBm cmFtZSAqLworICAgIGludCAgICAgICAgICAgICAgICAgIHRocmVhZF9leGl0OworICAgIGludCAg ICAgICAgICAgICAgICAgIHRocmVhZF9lcnJvcjsKKyAgICBpbnQgICAgICAgICAgICAgICAgICBp X3RocmVhZHNsaWNlX3N0YXJ0OyAvKiBmaXJzdCByb3cgaW4gdGhpcyB0aHJlYWQgc2xpY2UgKi8K KyAgICBpbnQgICAgICAgICAgICAgICAgICBpX3RocmVhZHNsaWNlX2VuZDsgLyogcm93IGFmdGVy IHRoZSBlbmQgb2YgdGhpcyB0aHJlYWQgc2xpY2UgKi8KIAogICAgIC8qIGJpdHN0cmVhbSBvdXRw dXQgKi8KICAgICBzdHJ1Y3QKZGlmZiAtLWdpdCBhL2VuY29kZXIvZW5jb2Rlci5jIGIvZW5jb2Rl ci9lbmNvZGVyLmMKaW5kZXggMGMwMDEwZi4uYmMwZTc1YiAxMDA2NDQKLS0tIGEvZW5jb2Rlci9l bmNvZGVyLmMKKysrIGIvZW5jb2Rlci9lbmNvZGVyLmMKQEAgLTQ3LDYgKzQ3LDUzIEBAIHN0YXRp YyBpbnQgeDI2NF9lbmNvZGVyX2ZyYW1lX2VuZCggeDI2NF90ICpoLCB4MjY0X3QgKnRocmVhZF9j dXJyZW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4MjY0X25hbF90ICoq cHBfbmFsLCBpbnQgKnBpX25hbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg eDI2NF9waWN0dXJlX3QgKnBpY19vdXQgKTsKIAorLyogdGhyZWFkaW5nICovCisKK3N0YXRpYyB2 b2lkICp4MjY0X3NsaWNlc193cml0ZV90aHJlYWQoIHgyNjRfdCAqaCApOworCisjaWZkZWYgSEFW RV9QVEhSRUFECitzdGF0aWMgdm9pZCB4MjY0X2ludF9jb25kX2Jyb2FkY2FzdCggeDI2NF9wdGhy ZWFkX2NvbmRfdCAqY3YsIHgyNjRfcHRocmVhZF9tdXRleF90ICptdXRleCwgaW50ICp2YXIsIGlu dCB2YWwgKQoreworICAgIHgyNjRfcHRocmVhZF9tdXRleF9sb2NrKCBtdXRleCApOworICAgICp2 YXIgPSB2YWw7CisgICAgeDI2NF9wdGhyZWFkX2NvbmRfYnJvYWRjYXN0KCBjdiApOworICAgIHgy NjRfcHRocmVhZF9tdXRleF91bmxvY2soIG11dGV4ICk7Cit9CisKK3N0YXRpYyB2b2lkIHgyNjRf aW50X2NvbmRfd2FpdCggeDI2NF9wdGhyZWFkX2NvbmRfdCAqY3YsIHgyNjRfcHRocmVhZF9tdXRl eF90ICptdXRleCwgaW50ICp2YXIsIGludCB2YWwgKQoreworICAgIHgyN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211dGV4ICk7Cit9CisKK3N0YXRpYyBpbnQgeDI2NF90aHJlYWRf cG9vbF93YWl0KCB4MjY0X3QgKmggKQoreworICAgIHgyNjRfaW50X2NvbmRfd2FpdCggJmgtPnRo cmVhZF9hY3RpdmVfY3YsICZoLT50aHJlYWRfYWN0aXZlX211dGV4LCAmaC0+dGhyZWFkX2FjdGl2 ZSwgMCApOworICAgIGgtPmJfdGhyZWFkX2FjdGl2ZSA9IDA7CisgICAgcmV0dXJuIGgtPnRocmVh ZF9lcnJvcjsKK30KKwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqCiAgKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiB4MjY0IGxpYnMgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKgpAQCAtOTQzLDYgKzk5MCwxNiBAQCB4MjY0X3QgKngyNjRfZW5jb2Rlcl9vcGVuKCB4MjY0 X3BhcmFtX3QgKnBhcmFtICkKICAgICBmb3IoIGkgPSAxOyBpIDwgaC0+cGFyYW0uaV90aHJlYWRz ICsgISFoLT5wYXJhbS5pX3N5bmNfbG9va2FoZWFkOyBpKysgKQogICAgICAgICBDSEVDS0VEX01B TExPQyggaC0+dGhyZWFkW2ldLCBzaXplb2YoeDI2NF90KSApOwogCisgICAgaWYoIGgtPnBhcmFt LmlfdGhyZWFkcyA+IDEgKQorICAgIHsKKyAgICAgICAgQ0hFQ0tFRF9NQUxMT0NaRVJPKCBoLT50 aHJlYWRfaGFuZGxlLCAoaC0+cGFyYW0uaV90aHJlYWRzICsgMSkgKiBzaXplb2YoeDI2NF9wdGhy ZWFkX3QpICk7CisgICAgICAgIENIRUNLRURfTUFMTE9DWkVSTyggaC0+dGhyZWFkX3F1ZXVlLCAo aC0+cGFyYW0uaV90aHJlYWRzICsgMSkgKiBzaXplb2YoeDI2NF90KikgKTsKKyAgICAgICAgaWYo IHgyNjRfcHRocmVhZF9jb25kX2luaXQoICZoLT50aHJlYWRfcXVldWVfY3YsIE5VTEwgKSApCisg ICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgIGlmKCB4MjY0X3B0aHJlYWRfbXV0ZXhfaW5p dCggJmgtPnRocmVhZF9xdWV1ZV9tdXRleCwgTlVMTCApICkKKyAgICAgICAgICAgIGdvdG8gZmFp bDsKKyAgICB9CisKICAgICBpZiggeDI2NF9sb29rYWhlYWRfaW5pdCggaCwgaV9zbGljZXR5cGVf bGVuZ3RoICkgKQogICAgICAgICBnb3RvIGZhaWw7CiAKQEAgLTk2Nyw2ICsxMDI0LDE0IEBAIHgy NjRfdCAqeDI2NF9lbmNvZGVyX29wZW4oIHgyNjRfcGFyYW1fdCAqcGFyYW0gKQogICAgICAgICBD SEVDS0VEX01BTExPQyggaC0+dGhyZWFkW2ldLT5vdXQubmFsLCBpbml0X25hbF9jb3VudCpzaXpl b2YoeDI2NF9uYWxfdCkgKTsKICAgICAgICAgaC0+dGhyZWFkW2ldLT5vdXQuaV9uYWxzX2FsbG9j YXRlZCA9IGluaXRfbmFsX2NvdW50OwogCisgICAgICAgIGlmKCBoLT5wYXJhbS5pX3RocmVhZHMg PiAxICkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoIHgyNjRfcHRocmVhZF9jb25kX2luaXQo ICZoLT50aHJlYWRbaV0tPnRocmVhZF9hY3RpdmVfY3YsIE5VTEwgKSApCisgICAgICAgICAgICAg ICAgZ290byBmYWlsOworICAgICAgICAgICAgaWYoIHgyNjRfcHRocmVhZF9tdXRleF9pbml0KCAm aC0+dGhyZWFkW2ldLT50aHJlYWRfYWN0aXZlX211dGV4LCBOVUxMICkgKQorICAgICAgICAgICAg ICAgIGdvdG8gZmFpbDsKKyAgICAgICAgfQorCiAgICAgICAgIGlmKCBhbGxvY2F0ZV90aHJlYWRs b2NhbF9kYXRhICYmIHgyNjRfbWFjcm9ibG9ja19jYWNoZV9pbml0KCBoLT50aHJlYWRbaV0gKSA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DMwIEBA IHN0YXRpYyB2b2lkICp4MjY0X3NsaWNlc193cml0ZSggeDI2NF90ICpoICkKICAgICAgICAgfQog ICAgICAgICBoLT5zaC5pX2xhc3RfbWIgPSBYMjY0X01JTiggaC0+c2guaV9sYXN0X21iLCBsYXN0 X3RocmVhZF9tYiApOwogICAgICAgICBpZiggeDI2NF9zdGFja19hbGlnbiggeDI2NF9zbGljZV93 cml0ZSwgaCApICkKLSAgICAgICAgICAgIHJldHVybiAodm9pZCAqKS0xOworICAgICAgICAgICAg cmV0dXJuIC0xOwogICAgICAgICBoLT5zaC5pX2ZpcnN0X21iID0gaC0+c2guaV9sYXN0X21iICsg MTsKICAgICB9CiAKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGludCB4MjY0X3NsaWNlc193 cml0ZSggeDI2NF90ICpoICkKK3sKKyNpZmRlZiBIQVZFX01NWAorICAgIC8qIE1pc2FsaWduIG1h c2sgaGFzIHRvIGJlIHNldCBzZXBhcmF0ZWx5IGZvciBlYWNoIHRocmVhZC4gKi8KKyAgICBpZigg aC0+cGFyYW0uY3B1JlgyNjRfQ1BVX1NTRV9NSVNBTElHTiApCisgICAgICAgIHgyNjRfY3B1X21h c2tfbWlzYWxpZ25fc3NlKCk7CisjZW5kaWYKKworI2lmIFZJU1VBTElaRQorICAgIGlmKCBoLT5w YXJhbS5iX3Zpc3VhbGl6ZSApCisgICAgICAgIGlmKCB4MjY0X3Zpc3VhbGl6ZV9pbml0KCBoICkg KQorICAgICAgICAgICAgcmV0dXJuIC0xOworI2VuZGlmCisKKyAgICBpZiggeDI2NF9zbGljZXNf d3JpdGVfaW50ZXJuYWwoIGggKSApCisgICAgICAgIHJldHVybiAtMTsKKwogI2lmIFZJU1VBTEla RQogICAgIGlmKCBoLT5wYXJhbS5iX3Zpc3VhbGl6ZSApCiAgICAgewpAQCAtMTg5OSwxMyArMTk3 Nyw0NyBAQCBzdGF0aWMgdm9pZCAqeDI2NF9zbGljZXNfd3JpdGUoIHgyNjRfdCAqaCApCiAgICAg fQogI2VuZGlmCiAKKyAgICByZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgKngyNjRfc2xpY2Vz X3dyaXRlX3RocmVhZCggeDI2NF90ICpoICkKK3sKKyAgICBpZiggaC0+cGFyYW0uaV9zeW5jX2xv b2thaGVhZCApCisgICAgICAgIHgyNjRfbG93ZXJfdGhyZWFkX3ByaW9yaXR5KCAxMCApOworCisj aWZkZWYgSEFWRV9NTVgKKyAgICAvKiBNaXNhbGlnbiBtYXNrIGhhcyB0byBiZSBzZXQgc2VwYXJh dGVseSBmb3IgZWFjaCB0aHJlYWQuICovCisgICAgaWYoIGgtPnBhcmFtLmNwdSZYMjY0X0NQVV9T U0VfTUlTQUxJR04gKQorICAgICAgICB4MjY0X2NwdV9tYXNrX21pc2FsaWduX3NzZSgpOworI2Vu ZGlmCisKKyAgICBmb3IoOzspCisgICAgeworICAgICAgICB4MjY0X3QgKnQgPSBOVUxMOworCisg ICAgICAgIC8vIGdldCBvbmUgZnJhbWUgZnJvbSB0aGUgcXVldWUKKyAgICAgICAgeDI2NF9wdGhy ZWFkX211dGV4X2xvY2soICZoLT50aHJlYWRfcXVldWVfbXV0ZXggKTsKKyAgICAgICAgd2hpbGUo ICFoLT50aHJlYWRfcXVldWVbMF0gJiYgIWgtPnRocmVhZF9leGl0ICkKKyAgICAgICAgICAgIHgy NjRfcHRocmVhZF9jb25kX3dhaXQoICZoLT50aHJlYWRfcXVldWVfY3YsICZoLT50aHJlYWRfcXVl dWVfbXV0ZXggKTsKKyAgICAgICAgaWYoIGgtPnRocmVhZF9xdWV1ZVswXSApCisgICAgICAgICAg ICB0ID0gKHZvaWQqKXgyNjRfZnJhbWVfc2hpZnQoICh2b2lkKiloLT50aHJlYWRfcXVldWUgKTsK KyAgICAgICAgeDI2NF9wdGhyZWFkX211dGV4X3VubG9jayggJmgtPnRocmVhZF9xdWV1ZV9tdXRl eCApOworICAgICAgICBpZiggaC0+dGhyZWFkX2V4aXQgKQorICAgICAgICAgICAgcmV0dXJuICh2 b2lkICopMDsKKyAgICAgICAgaWYoICF0ICkKKyAgICAgICAgICAgIGNvbnRpbnVlOworCisgICAg ICAgIHQtPnRocmVhZF9lcnJvciA9IHgyNjRfc2xpY2VzX3dyaXRlX2ludGVybmFsKCB0ICk7CisK KyAgICAgICAgeDI2NF9pbnRfY29uZF9icm9hZGNhc3QoICZ0LT50aHJlYWRfYWN0aXZlX2N2LCAm dC0+dGhyZWFkX2FjdGl2ZV9tdXRleCwgJnQtPnRocmVhZF9hY3RpdmUsIDAgKTsKKyAgICB9CisK ICAgICByZXR1cm4gKHZvaWQgKikwOwogfQogCiBzdGF0aWMgaW50IHgyNjRfdGhyZWFkZWRfc2xp Y2VzX3dyaXRlKCB4MjY0X3QgKmggKQogewogICAgIGludCBpLCBqOwotICAgIHZvaWQgKnJldCA9 IE5VTEw7CiAgICAgLyogc2V0IGZpcnN0L2xhc3QgbWIgYW5kIHN5bmMgY29udGV4dHMgKi8KICAg ICBmb3IoIGkgPSAwOyBpIDwgaC0+cGFyYW0uaV90aHJlYWRzOyBpKysgKQogICAgIHsKQEAgLTE5 MjgsMTQgKzIwNDAsMTAgQEAgc3RhdGljIGludCB4MjY0X3RocmVhZGVkX3NsaWNlc193cml0ZSgg eDI2NF90ICpoICkKIAogICAgIC8qIGRpc3BhdGNoICovCiAgICAgZm9yKCBpID0gMDsgaSA8IGgt PnBhcmFtLmlfdGhyZWFkczsgaSsrICkKLSAgICAgICAgaWYoIHgyNjRfcHRocmVhZF9jcmVhdGUo ICZoLT50aHJlYWRbaV0tPnRocmVhZF9oYW5kbGUsIE5VTEwsICh2b2lkKil4MjY0X3NsaWNlc193 cml0ZSwgKHZvaWQqKWgtPnRocmVhZFtpXSApICkKLSAgICAgICAgICAgIHJldHVybiAtMTsKKyAg ICAgICAgeDI2NF90aHJlYWRfcG9vbF9wdXNoKCBoLT50aHJlYWRbaV0gKTsKICAgICBmb3IoIGkg PSAwOyBpIDwgaC0+cGF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ggaCApICkKICAg ICAgICAgICAgIHJldHVybiAtMTsKICAgICB9CiAgICAgZWxzZQotICAgICAgICBpZiggKGludHB0 cl90KXgyNjRfc2xpY2VzX3dyaXRlKCBoICkgKQorICAgICAgICBpZiggeDI2NF9zbGljZXNfd3Jp dGUoIGggKSApCiAgICAgICAgICAgICByZXR1cm4gLTE7CiAKICAgICByZXR1cm4geDI2NF9lbmNv ZGVyX2ZyYW1lX2VuZCggdGhyZWFkX29sZGVzdCwgdGhyZWFkX2N1cnJlbnQsIHBwX25hbCwgcGlf bmFsLCBwaWNfb3V0ICk7CkBAIC0yMjYzLDEzICsyMzY3LDggQEAgc3RhdGljIGludCB4MjY0X2Vu Y29kZXJfZnJhbWVfZW5kKCB4MjY0X3QgKmgsIHgyNjRfdCAqdGhyZWFkX2N1cnJlbnQsCiAgICAg Y2hhciBwc3pfbWVzc2FnZVs4MF07CiAKICAgICBpZiggaC0+Yl90aHJlYWRfYWN0aXZlICkKLSAg ICB7Ci0gICAgICAgIHZvaWQgKnJldCA9IE5VTEw7Ci0gICAgICAgIHgyNjRfcHRocmVhZF9qb2lu KCBoLT50aHJlYWRfaGFuZGxlLCAmcmV0ICk7Ci0gICAgICAgIGlmKCAoaW50cHRyX3QpcmV0ICkK LSAgICAgICAgICAgIHJldHVybiAoaW50cHRyX3QpcmV0OwotICAgICAgICBoLT5iX3RocmVhZF9h Y3RpdmUgPSAwOwotICAgIH0KKyAgICAgICAgaWYoIHgyNjRfdGhyZWFkX3Bvb2xfd2FpdCggaCAp ICkKKyAgICAgICAgICAgIHJldHVybiAtMTsKICAgICBpZiggIWgtPm91dC5pX25hbCApCiAgICAg ewogICAgICAgICBwaWNfb3V0LT5pX3R5cGUgPSBYMjY0X1RZUEVfQVVUTzsKQEAgLTI0NzIsMTUg KzI1NzEsMjkgQEAgdm9pZCAgICB4MjY0X2VuY29kZXJfY2xvc2UgICggeDI2NF90ICpoICkKIAog ICAgIHgyNjRfbG9va2FoZWFkX2RlbGV0ZSggaCApOwogCi0gICAgZm9yKCBpID0gMDsgaSA8IGgt PnBhcmFtLmlfdGhyZWFkczsgaSsrICkKKyAgICBpZiggaC0+cGFyYW0uaV90aHJlYWRzID4gMSAp CiAgICAgewogICAgICAgICAvLyBkb24ndCBzdHJpY3RseSBoYXZlIHRvIHdhaXQgZm9yIHRoZSBv dGhlciB0aHJlYWRzLCBidXQgaXQncyBzaW1wbGVyIHRoYW4gY2FuY2VsaW5nIHRoZW0KLSAgICAg ICAgaWYoIGgtPnRocmVhZFtpXS0+Yl90aHJlYWRfYWN0aXZlICkKKyAgICAgICAgeDI2NF9wdGhy ZWFkX211dGV4X2xvY2soICZoLT50aHJlYWRfcXVldWVfbXV0ZXggKTsKKyAgICAgICAgaC0+dGhy ZWFkX2V4aXQgPSAxOworICAgICAgICB4MjY0X3B0aHJlYWRfY29uZF9icm9hZGNhc3QoICZoLT50 aHJlYWRfcXVldWVfY3YgKTsKKyAgICAgICAgeDI2NF9wdGhyZWFkX211dGV4X3VubG9jayggJmgt PnRocmVhZF9xdWV1ZV9tdXRleCApOworICAgICAgICBmb3IoIGkgPSAwOyBpIDwgaC0+cGFyYW0u aV90aHJlYWRzOyBpKysgKQorICAgICAgICAgICAgeDI2NF9wdGhyZWFkX2pvaW4oIGgtPnRocmVh ZF9oYW5kbGVbaV0sIE5VTEwgKTsKKyAgICAgICAgZm9yKCBpID0gMDsgaSA8IGgtPnBhcmFtLmlf dGhyZWFkczsgaSsrICkKICAgICAgICAgewotICAgICAgICAgICAgeDI2NF9wdGhyZWFkX2pvaW4o IGgtPnRocmVhZFtpXS0+dGhyZWFkX2hhbmRsZSwgTlVMTCApOwotICAgICAgICAgICAgYXNzZXJ0 KCBoLT50aHJlYWRbaV0tPmZlbmMtPmlfcmVmZXJlbmNlX2NvdW50ID09IDEgKTsKLSAgICAgICAg ICAgIHgyNjRfZnJhbWVfZGVsZXRlKCBoLT50aHJlYWRbaV0tPmZlbmMgKTsKKyAgICAgICAgICAg IHgyNjRfcHR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ICAgICAgICAgeDI2NF9mcmVlKCBoLT50aHJlYWRbaC0+cGFyYW0uaV90aHJlYWRzXS0+ c2NyYXRjaF9idWZmZXIgKTsKICAgICAgICAgeDI2NF9mcmVlKCBoLT50aHJlYWRbaC0+cGFyYW0u aV90aHJlYWRzXSApOwo= --000e0cd138b0d8bf1e047afdf84e-- -- 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/