Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7368241yba; Thu, 2 May 2019 08:42:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpdZuROnV6li/9DqnEzXZgx0IYepKEikjbDhMeD4OSgejjOt5HdZ1W+MFm1GIg0Sg3UjRT X-Received: by 2002:a17:902:ba89:: with SMTP id k9mr4504945pls.96.1556811741333; Thu, 02 May 2019 08:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556811741; cv=none; d=google.com; s=arc-20160816; b=ZzJ4ujk7kMTCsKOtSsku2xl8Yj9G3oD5GUDj/LzirfOdLY+CU6CZ7QRQfRqjrM5gdD aZIycVcpEcL15bCEXO4vcuV/o5iT3oH5GKlP98YMfFQl1MY7o4NkyuMAeybmJnoDcFTK 7YfXmDN2YiDcERqYOt3Q1VaWGdv/Fb7pAr6CtZghheOUT6nsA4VTTCiACLQ6Lv+UAvF8 Ls6ZLDa+qFfDGkio5gUYkQnhx7Ov8CZLkzosygyaRHgAjEHxNiBo3EL3tVYtvupK+5t4 DNL/kntFsAwxKCJ1W9+1/kjAzsKKlyQFHRaJCpamEOqZ80Qg2sezJkWcWdmn553yGtiw lkSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=RSDhRSRvqbQGJ2LHREuCN7qGXp3a6Z///hrRs7dnlmw=; b=lHoAeEwTQG9jzN3+0PItKHKS0c44XlQwOgveVEFok1HTjkPlnGualLnkIthZGzyCdM Oqya4lQyabTX1tpRcU+b7oF7o1YZ24kMsIFynj3MViJEYiwn5wvOJU2Ma/uB0YOEkHB1 OAFe52INBLubgD9vGe4eZi4o/WhceWcesCrEDdZmSZ61c40ve2aIOJl1ghXxHFEsAITH Yg5GxU4JFDSyhV6IxfDcsOhbYrgQqJVDltKjblXZ06uhGagZjhz0i6W/DhLWat1RoNKr 24wNKNkRT6aZxxFk9Wvrk+e2b8VeCVd0iGeFtKj6TehpymIIU/1jJOSniIIST8n9JxC8 BlHA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si41392258pgo.525.2019.05.02.08.42.06; Thu, 02 May 2019 08:42:21 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728771AbfEBPj2 (ORCPT + 99 others); Thu, 2 May 2019 11:39:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48026 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728488AbfEBP3g (ORCPT ); Thu, 2 May 2019 11:29:36 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x42FS9Cf139349 for ; Thu, 2 May 2019 11:29:35 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s800rs8gs-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 02 May 2019 11:29:34 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 May 2019 16:29:32 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 2 May 2019 16:29:24 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x42FTNNW48758890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 May 2019 15:29:23 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6193DA4053; Thu, 2 May 2019 15:29:23 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DAE81A4040; Thu, 2 May 2019 15:29:18 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.205.209]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 2 May 2019 15:29:18 +0000 (GMT) Received: by rapoport-lnx (sSMTP sendmail emulation); Thu, 02 May 2019 18:29:17 +0300 From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Catalin Marinas , Geert Uytterhoeven , Greentime Hu , Guan Xuetao , Guo Ren , Helge Deller , Ley Foon Tan , Matthew Wilcox , Matt Turner , Michael Ellerman , Michal Hocko , Palmer Dabbelt , Paul Burton , Richard Kuo , Richard Weinberger , Russell King , Sam Creasey , x86@kernel.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-um@lists.infradead.org, nios2-dev@lists.rocketboards.org, Mike Rapoport Subject: [PATCH 06/15] hexagon: switch to generic version of pte allocation Date: Thu, 2 May 2019 18:28:33 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556810922-20248-1-git-send-email-rppt@linux.ibm.com> References: <1556810922-20248-1-git-send-email-rppt@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19050215-0016-0000-0000-00000277A11A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050215-0017-0000-0000-000032D4362B Message-Id: <1556810922-20248-7-git-send-email-rppt@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-02_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=758 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905020103 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The hexagon implementation pte_alloc_one(), pte_alloc_one_kernel(), pte_free_kernel() and pte_free() is identical to the generic except of lack of __GFP_ACCOUNT for the user PTEs allocation. Switch hexagon to use generic version of these functions. Signed-off-by: Mike Rapoport --- arch/hexagon/include/asm/pgalloc.h | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h index d361838..7661a26 100644 --- a/arch/hexagon/include/asm/pgalloc.h +++ b/arch/hexagon/include/asm/pgalloc.h @@ -24,6 +24,8 @@ #include #include +#include /* for pte_{alloc,free}_one */ + #define check_pgt_cache() do {} while (0) extern unsigned long long kmap_generation; @@ -59,38 +61,6 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) free_page((unsigned long) pgd); } -static inline struct page *pte_alloc_one(struct mm_struct *mm) -{ - struct page *pte; - - pte = alloc_page(GFP_KERNEL | __GFP_ZERO); - if (!pte) - return NULL; - if (!pgtable_page_ctor(pte)) { - __free_page(pte); - return NULL; - } - return pte; -} - -/* _kernel variant gets to use a different allocator */ -static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) -{ - gfp_t flags = GFP_KERNEL | __GFP_ZERO; - return (pte_t *) __get_free_page(flags); -} - -static inline void pte_free(struct mm_struct *mm, struct page *pte) -{ - pgtable_page_dtor(pte); - __free_page(pte); -} - -static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) -{ - free_page((unsigned long)pte); -} - static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte) { -- 2.7.4