Received: by 10.223.176.5 with SMTP id f5csp1271483wra; Wed, 31 Jan 2018 04:02:42 -0800 (PST) X-Google-Smtp-Source: AH8x225iQHu0u5eY3p7uH+pqZlIuTix6LSJYrZro4ePiyQNQswIJnxuKUhkDFGKoVFWItZxB7ZCz X-Received: by 10.99.42.14 with SMTP id q14mr2532251pgq.183.1517400162263; Wed, 31 Jan 2018 04:02:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517400162; cv=none; d=google.com; s=arc-20160816; b=mheHEYjXuPHw3Vl5nW0Z5xIXrNRtlQnOsD6f/s4jFa2DHxuvWEvGviq8EASrnDsc82 Iin+1nYbg/jtnPRD12Pz7AxDZU5J+mfboJIxAyY9ffbdQHi98bxERgNh5u2Z4SVI5B1J 8Erisuzx6KqmA3gZNWb09+HlnENXp0XI0jRZxvI2hK7kdnLffgXL5w3h7dNzvGwkmaPX vJTQ51is7PR4PZOrG8EctpEQy2MkC8PUnRp2V+BZ0BsQxsBrqkFzd3i8pazKNOa69sFZ HaRZILt49KQhPXVVezaROg5Jyeid7qnSSUJVjN1EQuR3ruDZT7V+Q5JcofYVC51dgr9j zzVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ZpIyZFd7utCCpNSYI25LZorEA2lYQZU/B8JBe3CdNUE=; b=r0mklHoDeahMYPJTcZ5TCGeQjpgZT807AyuwkkbVJItl1MBLNbM1p+ZNAd6mLv9bnj bng0rirg+DJSDBYa4Xwq2GF4uev4q3/gmM8Yxozv4xEYrrUnihYhaP4YBx6TxAqMyJKT Zxc36Sj4JrlDY3WZvUuIEp5vIfhN8EhZwlVmeTtrYSND7vNF+Vh5QGuCMRi0ev+IO/Vt ny7gtPNotdl+e2kiRhFYA6/AWXxUxa0QP+1lEPBdp9NGALGRwNum8m84NIg5eHiT437e +ljPiqrZ0/Fs2lp+DWDk1dvVMTGuJudftgdb1bBj0OVywECz2KsOU17Ch01IKyolv+nk nztA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IG4N7aiu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13-v6si4713956plo.242.2018.01.31.04.02.27; Wed, 31 Jan 2018 04:02:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IG4N7aiu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752843AbeAaLZh (ORCPT + 99 others); Wed, 31 Jan 2018 06:25:37 -0500 Received: from mail-oi0-f65.google.com ([209.85.218.65]:41476 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751001AbeAaLZf (ORCPT ); Wed, 31 Jan 2018 06:25:35 -0500 Received: by mail-oi0-f65.google.com with SMTP id m83so10267393oik.8 for ; Wed, 31 Jan 2018 03:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ZpIyZFd7utCCpNSYI25LZorEA2lYQZU/B8JBe3CdNUE=; b=IG4N7aiu8ZYaTEup7iXNT949h1gE/2gkG5bsfob54k8EZ7kXvt7cMcdPXnb0nyIbJr aM367MwyJidF0y8qF1iLPOmqAxHIAbC0yWMClSn809OTQXrv/O593kQI9ZcedN4eW50Q AC124gaEp9KhxynhvhcsBIrlUm55Vp14Ngmht/gQg+VT0GqCA2QKwWDlHCJuejU9dfbT iMeMXfuwmjgyDy6ugres9qo+oElZcKIzKwMkZcZ0Ahie5/RCSu/0Zf1oVSKoBUTiyiD3 2hPlA04YNz8fB0Hohq6/vUbxCqXp2WLQFgcDS0yLryuWXgEP0FnBGetW6w52D5nWf6BG zeNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ZpIyZFd7utCCpNSYI25LZorEA2lYQZU/B8JBe3CdNUE=; b=ZV2bDX4F8wzItfUgRJxAOHMNld7zse3o0NcrY3F7vR4oIIb5Yz5RmVVYaq9mxkDT6V ROhzWG+E6ckFt/Pa5n9FrzW8v9N/3OmqlR+XSJfpD9HHT4epHxvjbdmHiLLBtTrASKUS XnkuEB3GPOiZmQTDaD0sz610nOjlA45M7WOQyBq6gzbBRqFEchB+rNy6oZdCtv0TV/il M/v+YqKcySXVk24WW8PEbSoVLreQtu8PkwTYEcgPEbr7ZWLdeSTwwJJ+5cvBVDy5GmaB hXqOQWhEdNLbOzofqaNANR5KOsaAUztnjSxm81v2LlitxnossfhjmwvBOXzkFRW6OhES 2m6w== X-Gm-Message-State: AKwxytdzaNr9KTXK3r9qByd4og4r/K+n0dom+CWoHR0AnkLyWh2swOxx bNxeHmFw8mB27uvD7/aGMRRL9sy20vLYmcss/y4= X-Received: by 10.202.91.69 with SMTP id p66mr14092228oib.64.1517397935294; Wed, 31 Jan 2018 03:25:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.68.33 with HTTP; Wed, 31 Jan 2018 03:25:33 -0800 (PST) In-Reply-To: <20180129235710.GA9418@n2100.armlinux.org.uk> References: <20180129234900.11121-1-anders.roxell@linaro.org> <20180129235710.GA9418@n2100.armlinux.org.uk> From: Arnd Bergmann Date: Wed, 31 Jan 2018 12:25:33 +0100 X-Google-Sender-Auth: z81cbHvh66_hpwwNuKFXTBu0L_8 Message-ID: Subject: Re: [PATCH] arch/arm/Kconfig: enable ARM_MODULE_PLTS when LOCKDEP=y To: Russell King - ARM Linux Cc: Anders Roxell , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 30, 2018 at 12:57 AM, Russell King - ARM Linux wrote: > On Tue, Jan 30, 2018 at 12:49:00AM +0100, Anders Roxell wrote: >> While testing multi_v7_defconfig with LOCKDEP enabled, the kernel >> fails to load simple modules, as reported by kselftest: >> >> [ 34.107620] test_printf: section 4 reloc 2 sym 'memset': relocation >> 28 out of range (0xbf046044 -> 0xc109f720) >> selftests: printf.sh [FAIL] >> >> The problem that is seen when LOCKDEP is enabled without >> ARM_MODULE_PLTS, is that LOCKDEP eats so much memory that the top of the >> kernel gets out of reach from the bottom of the module area. > > This really doesn't follow IMHO - enabling various features can cause > this, and we're not going to end up stuffing the Kconfig full of these > select statements each time we find a combination of Kconfig symbols > that cause it. > > lockdep isn't that special - I can (and do) build kernels with lockdep > enabled, with modules, and I do not run into this problem. So it's > not as simple as you make out in this commit description. > > It's likely that you have either a fairly full kernel configuration (it > must be to place memset() more than 16MB) or you are not placing the > kernel at 0xc0008000 due to memory reservations in the low memory. > >> Suggested-by: Arnd Bergmann > > I guess this was discussed privately with Arnd, since there's no record > of the discussion on the lists - which is even more reason why the > commit message needs to describe better why you need this change. I don't remember the original discussion exactly, but it's clear that the addition of LOCKDEP to the build is what caused the size to grow dramatically and prevent module loading. There are two alternative ways to do this without forcing ARM_MODULE_PLTS on all the time (which also triggered the 0day bot warning): a) we could make ARM_MODULE_PLTS default to 'y' when LOCKDEP is anbled, making it a more reasonable default while also letting users turn it off when the lockdep-enabled kernel is still small enough b) The Kconfig fragment that Anders uses which turns on LOCKDEP could simply enable ARM_MODULE_PLTS as well. That would be the easiest solution for him. I assume he already does it, but it's likely that others run into the same issue with kselftest testing. Arnd