From patchwork Mon Jan 21 08:04:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 10772937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DEB46C2 for ; Mon, 21 Jan 2019 08:05:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DEC720415 for ; Mon, 21 Jan 2019 08:05:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4115829D1B; Mon, 21 Jan 2019 08:05:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EB3A28524 for ; Mon, 21 Jan 2019 08:05:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5467D8E0022; Mon, 21 Jan 2019 03:05:50 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4F3E48E0018; Mon, 21 Jan 2019 03:05:50 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E57C8E0022; Mon, 21 Jan 2019 03:05:50 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by kanga.kvack.org (Postfix) with ESMTP id 153238E0018 for ; Mon, 21 Jan 2019 03:05:50 -0500 (EST) Received: by mail-qt1-f197.google.com with SMTP id b16so19921527qtc.22 for ; Mon, 21 Jan 2019 00:05:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=9rHOo/wC8+nXxpT2YUKJIxgVyD2iNlf5RmUP9KlDBco=; b=k9Xf+Hztd18P8mKt98ZSdhDXN77i4pGT/6NbdlSed01FJ3iUZijTBULuXOnK/vppLD H1HHqiZQFDAOBiiE+Z+LrfGLtTZFe3U+qstzPiOUGkLpPq0R8679vdeaflqSrle8Qe2g Yv3Lv0CTKqXhlDzcIK7MUEgLYZq3vm/qIXYlFj+L03VZRpiyF7AUk4WJyz/9jDxkeULL cz/J/mSVlI/twlwpHXJBB43jEm7yJLRYnbUmbE8O2y72UXaV0RgbBRe3Drvd5dbOWiIe 4WzdrzaiLcZ/F/PHFzjS5yxKOlYp+4VGy80ABIysq9G5YyayDYwcXL8XEXsmu+G25JlI NDkA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AJcUukeX7hqhE7EdhWDVvASCccLIbBTEHwsHILQJzdq/Om/rodXTs9kO uhGJUw79LpPi7KG5/LKzoScHHwV6zo+3gKt+8H6KGkTgvYHC/StWZZe9rjajZGl6ERoNb12QD6U 0En9ah9prQSfZuoPLEl0Sd0srXmxnaEFSr/tjJCV7baTmRiz4SaK0hPjLt3Fcwku7pw== X-Received: by 2002:ac8:1102:: with SMTP id c2mr26180741qtj.195.1548057949866; Mon, 21 Jan 2019 00:05:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ghEO74RTXs7HuTRQj6CHlwputI8JvYM9jYSt+hcpgnFTlHyZU8YxMwJEgFygc8bjC0sDH X-Received: by 2002:ac8:1102:: with SMTP id c2mr26180706qtj.195.1548057949278; Mon, 21 Jan 2019 00:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548057949; cv=none; d=google.com; s=arc-20160816; b=AA6+Z+mT+dSreGhoJcQa8vxIQko07YgTq8nfnGEBWba2rtJnaJYujtfcpH7eXKtfMA IlHGfZjdHRYkgVYM05zAFmf5ccrZ61aj2FLg7LK8MuNfB5q4k2UHgU4Yt4bW/67sBR3e rHFsHEwbLBvamnqSxBLPPbtcjjqPhIxtqg5YtMoOSQ1ebPYnAmybsVjKJjtOXu6BM2qc djdqv43KtEVDo8YEMyqpcVtffyVLCKokE8F+yK6FCuh+9vlayZ8ymu6JhwMQIZE2WPhy ttlycilX3XS7bv8SpJv9kuVF+qTpIwYxvHStsEWs8us/+ex0L6OXvhK0RarJRjG2L1hU TR5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from; bh=9rHOo/wC8+nXxpT2YUKJIxgVyD2iNlf5RmUP9KlDBco=; b=wOSvj48k2T5SNzaGCqVcAI0LSukDFIx5g1GTvBfnYZgNPPMR948PcBc0O5gjxjcv/V SwL5zwglexWhow1fYP2lZEvAp9XlGRAIclPZM4z4jsy9vasG3ylG9awb7jykalCXMgU6 4P02yCfpN2ZXzeVfQ6I54/jMakugxvWoOviJSSWYtWlThAUz82tTnfVWCIBPyMZUZ57n dzfu2YUsFNAUBq63SlGXGYJqpNoiVgye9cFBcLyn+ylGAUwoWd76VPMZ/pxf6E20oGbZ c4qgtXJaYWZnn+a4pEQXnLnyvzQRX1v1MDsaFAKst/K9Eh4YZpTqx0Imx2dResyqD+Oa BeAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id k15si1670981qvc.27.2019.01.21.00.05.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jan 2019 00:05:49 -0800 (PST) Received-SPF: pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rppt@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=rppt@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0L850Zm131766 for ; Mon, 21 Jan 2019 03:05:48 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q590xu378-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 21 Jan 2019 03:05:48 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Jan 2019 08:05:45 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 21 Jan 2019 08:05:33 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0L85WDa57737362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Jan 2019 08:05:32 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E13D52052; Mon, 21 Jan 2019 08:05:32 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.207.125]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 9446052051; Mon, 21 Jan 2019 08:05:27 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Mon, 21 Jan 2019 10:05:25 +0200 From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , Catalin Marinas , Christoph Hellwig , "David S. Miller" , Dennis Zhou , Geert Uytterhoeven , Greentime Hu , Greg Kroah-Hartman , Guan Xuetao , Guo Ren , Heiko Carstens , Mark Salter , Matt Turner , Max Filippov , Michael Ellerman , Michal Simek , Paul Burton , Petr Mladek , Rich Felker , Richard Weinberger , Rob Herring , Russell King , Stafford Horne , Tony Luck , Vineet Gupta , Yoshinori Sato , devicetree@vger.kernel.org, kasan-dev@googlegroups.com, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-usb@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org, xen-devel@lists.xenproject.org, Mike Rapoport Subject: [PATCH v2 13/21] arch: don't memset(0) memory returned by memblock_alloc() Date: Mon, 21 Jan 2019 10:04:00 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> References: <1548057848-15136-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19012108-0020-0000-0000-000003092EB6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19012108-0021-0000-0000-0000215A5BFF Message-Id: <1548057848-15136-14-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-21_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901210066 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP memblock_alloc() already clears the allocated memory, no point in doing it twice. Signed-off-by: Mike Rapoport Acked-by: Geert Uytterhoeven # m68k --- arch/c6x/mm/init.c | 1 - arch/h8300/mm/init.c | 1 - arch/ia64/kernel/mca.c | 2 -- arch/m68k/mm/mcfmmu.c | 1 - arch/microblaze/mm/init.c | 6 ++---- arch/sparc/kernel/prom_32.c | 2 -- 6 files changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c index af5ada0..e83c046 100644 --- a/arch/c6x/mm/init.c +++ b/arch/c6x/mm/init.c @@ -40,7 +40,6 @@ void __init paging_init(void) empty_zero_page = (unsigned long) memblock_alloc(PAGE_SIZE, PAGE_SIZE); - memset((void *)empty_zero_page, 0, PAGE_SIZE); /* * Set up user data space diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c index 6519252..a157890 100644 --- a/arch/h8300/mm/init.c +++ b/arch/h8300/mm/init.c @@ -68,7 +68,6 @@ void __init paging_init(void) * to a couple of allocated pages. */ empty_zero_page = (unsigned long)memblock_alloc(PAGE_SIZE, PAGE_SIZE); - memset((void *)empty_zero_page, 0, PAGE_SIZE); /* * Set up SFC/DFC registers (user data space). diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 74d148b..370bc34 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -400,8 +400,6 @@ ia64_log_init(int sal_info_type) // set up OS data structures to hold error info IA64_LOG_ALLOCATE(sal_info_type, max_size); - memset(IA64_LOG_CURR_BUFFER(sal_info_type), 0, max_size); - memset(IA64_LOG_NEXT_BUFFER(sal_info_type), 0, max_size); } /* diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c index 0de4999..492f953 100644 --- a/arch/m68k/mm/mcfmmu.c +++ b/arch/m68k/mm/mcfmmu.c @@ -44,7 +44,6 @@ void __init paging_init(void) int i; empty_zero_page = (void *) memblock_alloc(PAGE_SIZE, PAGE_SIZE); - memset((void *) empty_zero_page, 0, PAGE_SIZE); pg_dir = swapper_pg_dir; memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir)); diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index 44f4b89..bd1cd4b 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@ -376,10 +376,8 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask) if (mem_init_done) p = kzalloc(size, mask); - else { + else p = memblock_alloc(size, SMP_CACHE_BYTES); - if (p) - memset(p, 0, size); - } + return p; } diff --git a/arch/sparc/kernel/prom_32.c b/arch/sparc/kernel/prom_32.c index 38940af..e7126ca 100644 --- a/arch/sparc/kernel/prom_32.c +++ b/arch/sparc/kernel/prom_32.c @@ -33,8 +33,6 @@ void * __init prom_early_alloc(unsigned long size) void *ret; ret = memblock_alloc(size, SMP_CACHE_BYTES); - if (ret != NULL) - memset(ret, 0, size); prom_early_allocated += size;