From patchwork Wed Mar 12 17:08:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 3819701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EB75A9F369 for ; Wed, 12 Mar 2014 17:14:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26D53202B4 for ; Wed, 12 Mar 2014 17:14:26 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38B1220108 for ; Wed, 12 Mar 2014 17:14:25 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNmjT-0002cS-8x; Wed, 12 Mar 2014 17:14:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNmeb-0003QW-F8; Wed, 12 Mar 2014 17:09:17 +0000 Received: from mail-qa0-f49.google.com ([209.85.216.49]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNmeY-0003Ps-Bb for linux-arm-kernel@lists.infradead.org; Wed, 12 Mar 2014 17:09:14 +0000 Received: by mail-qa0-f49.google.com with SMTP id j7so2807565qaq.36 for ; Wed, 12 Mar 2014 10:08:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=9p8QORazNTWI66BLsZSp6FVgeuObGcK8iWTKB00kkPg=; b=l8eAocQny4ojNq33EgzDjwbEbcbs6JrMGWfoxfDrm68qxOkGQPL04H7QPW8Nq8vga2 msPV0mq+Fqhm42esYGi+kBNqG6XPzEzb/9Tq6Ui5PLVr7cI9FRVrv/TKFJQxi4NMqSce +WeE7LvTbMxVRQnrOrJy41/l2i5d6me+FEwRyKM1hSWw5pWEaqhQ46tSj9/Yd1gaq7Kv bDHNk2IkzLFvBsLxXFZemqdwqLM/tM4wi8TtV0RGjIU95ERTRV4Nih3U0KcZeaQHKHcR rxvCfWyMeSsqoyOfxw0GzVizSlzwOwu1TGTra8HIJGeyHK7ncdtJM/IKDNJfmzimL0yE rYsQ== X-Gm-Message-State: ALoCoQn2TjXdvOf7LDaFEQocTshxbj5HGGDDoL4J9UE0ry9FcZWanEZK0REF3BJuoXSnnAZCgB1b X-Received: by 10.224.25.73 with SMTP id y9mr3556372qab.101.1394644126552; Wed, 12 Mar 2014 10:08:46 -0700 (PDT) Received: from xanadu.home (modemcable177.143-130-66.mc.videotron.ca. [66.130.143.177]) by mx.google.com with ESMTPSA id r110sm37183863qgd.1.2014.03.12.10.08.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 10:08:44 -0700 (PDT) Date: Wed, 12 Mar 2014 13:08:42 -0400 (EDT) From: Nicolas Pitre To: Liu hua Subject: Re: [ARM]Fixmap mapping region is not enough for system of 14+ CPUs. In-Reply-To: <53204956.30703@huawei.com> Message-ID: References: <53203F9C.8040500@huawei.com> <53204956.30703@huawei.com> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140312_130914_438009_D3160DFD X-CRM114-Status: GOOD ( 18.53 ) X-Spam-Score: -2.6 (--) Cc: Wang Nan , wangkefeng.wang@huawei.com, Russell King - ARM Linux , peifeiyue@huawei.com, Will Deacon , linux-kernel@vger.kernel.org, Li Zefan , msalter@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 12 Mar 2014, Liu hua wrote: > Hi Russell, Will or Nicolas, > > (In this mail, we only discuss ARM 32-bit linux.) > > As we know, the region (0xfff00000-0xfffdffff) is reserved as fixmap > mapping region. > > The function "kmap_atomic" maps highmem pages to this region referring > to CPUID and per-cpu variable "__kmap_atomic_idx" via > > idx = type + KM_TYPE_NR * smp_processor_id(); > vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); > > Size of region used by one cpu is 0x10000 (KM_TYPE_NR << PAGE_SHIFT). > And the total size of the fixmap mapping region is 0xe0000. > (only support 14 CPUs). > > So in a system of more than 14 CPUs, this region is not large enough. > should we change the memory layout on ARM Linux to support 14+ cpu system ? > Or can we do anything else to support that ? How many CPUs do you have? What about the following patch? If this doesn't work for you then more intrusive changes will be needed. Nicolas diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h index 68ea615c2a..254f2df08d 100644 --- a/arch/arm/include/asm/fixmap.h +++ b/arch/arm/include/asm/fixmap.h @@ -14,7 +14,17 @@ */ #define FIXADDR_START 0xfff00000UL + +#if !defined(CONFIG_HAVE_TCM) && !defined(CONFIG_CPU_XSCALE) +/* + * If no TCM nor on on a XScale then enlarge the fixmap area to + * accommodate up to 30 CPUs. + */ +#define FIXADDR_END 0xffff0000UL +#else #define FIXADDR_END 0xfffe0000UL +#endif + #define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE) enum fixed_addresses {