Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbaKUWzb (ORCPT ); Fri, 21 Nov 2014 17:55:31 -0500 Received: from mail-qc0-f175.google.com ([209.85.216.175]:37266 "EHLO mail-qc0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752613AbaKUWz2 (ORCPT ); Fri, 21 Nov 2014 17:55:28 -0500 MIME-Version: 1.0 In-Reply-To: References: <20141120233920.GC25393@htj.dyndns.org> <20141121162742.GB15461@htj.dyndns.org> <20141121170805.GD30603@home.goodmis.org> Date: Fri, 21 Nov 2014 14:55:27 -0800 X-Google-Sender-Auth: QcL9s9REuQDsKs6ZewsNSiYK3cU Message-ID: Subject: Re: frequent lockups in 3.18rc4 From: Linus Torvalds To: Thomas Gleixner Cc: Andy Lutomirski , Steven Rostedt , Tejun Heo , "linux-kernel@vger.kernel.org" , Arnaldo Carvalho de Melo , Peter Zijlstra , Frederic Weisbecker , Don Zickus , Dave Jones , "the arch/x86 maintainers" Content-Type: multipart/mixed; boundary=001a11c1edfe46f03505086657fc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --001a11c1edfe46f03505086657fc Content-Type: text/plain; charset=UTF-8 On Fri, Nov 21, 2014 at 1:11 PM, Thomas Gleixner wrote: > > I'm fine with that. I just think it's not horrid enough, but that can > be fixed easily :) Oh, I think it's plenty horrid. Anyway, here's an actual patch. As usual, it has seen absolutely no actual testing, but I did try to make sure it compiles and seems to do the right thing on: - x86-32 no-PAE - x86-32 no-PAE with PARAVIRT - x86-32 PAE - x86-64 also, I just removed the noise that is "vmalloc_sync_all()", since it's just all garbage and nothing actually uses it. Yeah, it's used by "register_die_notifier()", which makes no sense what-so-ever. Whatever. It's gone. Can somebody actually *test* this? In particular, in any kind of real paravirt environment? Or, any comments even without testing? I *really* am not proud of the mess wrt the whole #ifdef CONFIG_PARAVIRT #ifdef CONFIG_X86_32 ... but I think that from a long-term perspective, we're actually better off with this kind of really ugly - but very explcit - hack that very clearly shows what is going on. The old code that actually "walked" the page tables was more "portable", but was somewhat misleading about what was actually going on. Comments? Linus --001a11c1edfe46f03505086657fc Content-Type: text/plain; charset=US-ASCII; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i2s58chi0 IGFyY2gveDg2L21tL2ZhdWx0LmMgfCAyNDMgKysrKysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDU4IGluc2VydGlvbnMoKyks IDE4NSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9hcmNoL3g4Ni9tbS9mYXVsdC5jIGIvYXJj aC94ODYvbW0vZmF1bHQuYwppbmRleCBkOTczZTYxZTQ1MGQuLjRiMGExYjk0MDRiMSAxMDA2NDQK LS0tIGEvYXJjaC94ODYvbW0vZmF1bHQuYworKysgYi9hcmNoL3g4Ni9tbS9mYXVsdC5jCkBAIC00 Miw2ICs0Miw2NCBAQCBlbnVtIHg4Nl9wZl9lcnJvcl9jb2RlIHsKIH07CiAKIC8qCisgKiBIYW5k bGUgYSBwb3NzaWJsZSB2bWFsbG9jIGZhdWx0LiBXZSBqdXN0IGNvcHkgdGhlCisgKiB0b3AtbGV2 ZWwgcGFnZSB0YWJsZSBlbnRyeSBpZiBuZWNlc3NhcnkuCisgKgorICogV2l0aCBQQUUsIHRoZSB0 b3AtbW9zdCBwZ2QgZW50cnkgaXMgYWx3YXlzIHNoYXJlZCwKKyAqIGFuZCB0aGF0J3Mgd2hlcmUg dGhlIHZtYWxsb2MgYXJlYSBpcy4gIFNvIFBBRSBoYWQKKyAqIGJldHRlciBuZXZlciBoYXZlIGFu eSB2bWFsbG9jIGZhdWx0cy4KKyAqCisgKiBOT1RFISBUaGlzIG9uIHB1cnBvc2UgZG9lcyAqTk9U KiB1c2UgcGdkX3ByZXNlbnQoKQor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JPQkVf U1lNQk9MKHZtYWxsb2NfZmF1bHQpOwotCiAjaWZkZWYgQ09ORklHX0NQVV9TVVBfQU1ECiBzdGF0 aWMgY29uc3QgY2hhciBlcnJhdGE5M193YXJuaW5nW10gPQogS0VSTl9FUlIgCg== --001a11c1edfe46f03505086657fc-- -- 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/