Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965410AbbHKQaq (ORCPT ); Tue, 11 Aug 2015 12:30:46 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:36617 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965336AbbHKQap (ORCPT ); Tue, 11 Aug 2015 12:30:45 -0400 Subject: Re: [PATCH v5 2/6] x86/kasan, mm: introduce generic kasan_populate_zero_shadow() To: Catalin Marinas References: <1439259499-13913-1-git-send-email-ryabinin.a.a@gmail.com> <1439259499-13913-3-git-send-email-ryabinin.a.a@gmail.com> <20150811154117.GH23307@e104818-lin.cambridge.arm.com> Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, Yury , Alexey Klimov , Arnd Bergmann , linux-mm@kvack.org, Linus Walleij , x86@kernel.org, linux-kernel@vger.kernel.org, David Keitel , Alexander Potapenko , "Aneesh Kumar K.V" , "H. Peter Anvin" , Andrew Morton , Ingo Molnar , Thomas Gleixner , Dmitry Vyukov From: Andrey Ryabinin Message-ID: <55CA2332.7040206@gmail.com> Date: Tue, 11 Aug 2015 19:30:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150811154117.GH23307@e104818-lin.cambridge.arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 936 Lines: 26 On 08/11/2015 06:41 PM, Catalin Marinas wrote: > On Tue, Aug 11, 2015 at 05:18:15AM +0300, Andrey Ryabinin wrote: >> --- /dev/null >> +++ b/mm/kasan/kasan_init.c > [...] >> +#if CONFIG_PGTABLE_LEVELS > 3 >> +pud_t kasan_zero_pud[PTRS_PER_PUD] __page_aligned_bss; >> +#endif >> +#if CONFIG_PGTABLE_LEVELS > 2 >> +pmd_t kasan_zero_pmd[PTRS_PER_PMD] __page_aligned_bss; >> +#endif >> +pte_t kasan_zero_pte[PTRS_PER_PTE] __page_aligned_bss; > > Is there any problem if you don't add the #ifs here? Wouldn't the linker > remove them if they are not used? > AFAIK such optimization is possible if we build with -fdata-sections flag and use --gc-sections flag in linker, but we don't do this. -- 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/