From patchwork Wed May 23 18:24:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10422027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2604360224 for ; Wed, 23 May 2018 18:24:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 178342910F for ; Wed, 23 May 2018 18:24:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C3CF29126; Wed, 23 May 2018 18:24:26 +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 A3D4E2910F for ; Wed, 23 May 2018 18:24:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47C946B000C; Wed, 23 May 2018 14:24:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 389BA6B000D; Wed, 23 May 2018 14:24:21 -0400 (EDT) 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 1B3AC6B000E; Wed, 23 May 2018 14:24:21 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id E12FD6B000C for ; Wed, 23 May 2018 14:24:20 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id 5-v6so2337371qke.19 for ; Wed, 23 May 2018 11:24:20 -0700 (PDT) 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:message-id:in-reply-to:references; bh=REPMrlCXk+bNlz+Pg6nTiOLOP5N73fEEXA1YvcSxsVE=; b=hVIiSpT5OdtmnVZDnbtBE9QFILl67Zu4/8/V9XlFBY8IwwfSbB+34O9sbCZmCUDQuU AI+QEHJ761XYFPXQHh4j2FY1S1Pt2py/Tz4Q8fWnXAUBoYqXwOnyrslvjfmuiHFfa6le ViKd+TPSEc8my4dGCAsFE+dT54YKMHH1U4ia2PLF5F0igoKWZULGajGECYycFStt5tou 6SG6GaIyNWlhFlD6oBz9a4zapf55tE7iCqJfFFieiYV4QHcEbD3zZFE640JegeHf/DW3 ejRHhlj4GcAkkKB+yWHhKlpv9c1A6fzYhDRZhhDBBxOUU6es/kSF7Y6WgCuUYKheRDvT Wilw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ALKqPwcokbPpK5hAvVCctIkSqqmK6vdWZTrNU5uTEVDh4aVlGx7NSC/9 JCML1LJ3HnbEuWu7kz0a5n9RI+YPCqZ3hOhBCe/wl4NoZThPymj6FmQrZ+Ff+nRhDqZxpCvKYfX 1DO8+LFXrfQNsP9VswDSmqBKCSXqRE7ZqQcuOew47H7a2gTcdz/p6Dofu2HvQ5eqeJw== X-Received: by 2002:ac8:33a3:: with SMTP id c32-v6mr3805904qtb.90.1527099860648; Wed, 23 May 2018 11:24:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIv1phDYkgiVnTIIK+xjku5LTatq37pn/Ul155FekVJOx2KO0AjcqsFAuFb/ryeTU5zWzOA X-Received: by 2002:ac8:33a3:: with SMTP id c32-v6mr3805871qtb.90.1527099860127; Wed, 23 May 2018 11:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527099860; cv=none; d=google.com; s=arc-20160816; b=UGd+1VUyMrSsimZxUpoytUGm04aQYnwBnSyRfLhxDuMAKKF11owzk2o8d9ShjVDhlG U6I/AAvzmgMUATghwcFSHwvEvZC/qxH5iG/26phHmPOVCPXV6ed0z7Kdo/OwfsJtm8x4 Vai/+q0knsDqq8xHB3/RWGrbXrHRVuVdqOCeI+9BYzrjz8+vWivrQzS/QviqgcCegfSg bRe2ltEqxwXvSAS7RTYcHcLBOPLOhjdm1+curkFDHEQwU8Cz7o906rPnpr4pCZtnI8hY EKMiruFDpJ2J9LkgQ23mu1ycOyoR6qQuaHMXh/m0Y0tLqVm4b5LG7nfdw1HD4U9l9Et6 BkiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=REPMrlCXk+bNlz+Pg6nTiOLOP5N73fEEXA1YvcSxsVE=; b=ww6fa/Rpt4s0PNiZHONNnNE6Vzadd1DKmLo6tIcUWfAsj1vHpracmWQgMvNEODWyJn doEYMQZSRwzU7/aXJkVezHCB26y0GOs3UpulfFlS0Jj/7KmMF+jkPcJmINnLeqekhwcF AIB29bJ9bXfifGoo2t4yoX6n/y/KyFp9W/IEQ87gPqHFSeWSzx6rD+JFjW8SrDWYnHHq JuS5v2yI4XMjBvA5qeipimNriPEnozuEgJJ0OImH6jGvHTqhzLOgvOHTk+R0qgSzRRqx b4uftttpYKlJxFkk/DvVrF+XoqV8+N1o4oLt01ihY0XuAZ+1B0KDYfyb6Uro2QHxOeME Hs3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id j5-v6si2158014qvi.225.2018.05.23.11.24.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 11:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB0A840241EE; Wed, 23 May 2018 18:24:19 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-62.ams2.redhat.com [10.36.116.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A13010C5653; Wed, 23 May 2018 18:24:18 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, David Hildenbrand , Martin Schwidefsky , Heiko Carstens , Michal Hocko , Andrew Morton , Vlastimil Babka , Greg Kroah-Hartman , linux-s390@vger.kernel.org Subject: [PATCH RFCv2 3/4] s390: numa: implement memory_add_physaddr_to_nid() Date: Wed, 23 May 2018 20:24:03 +0200 Message-Id: <20180523182404.11433-4-david@redhat.com> In-Reply-To: <20180523182404.11433-1-david@redhat.com> References: <20180523182404.11433-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 23 May 2018 18:24:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 23 May 2018 18:24:19 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' 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 The common interface to be used with add_memory(). Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Michal Hocko Cc: Andrew Morton Cc: Vlastimil Babka Cc: Greg Kroah-Hartman Cc: linux-s390@vger.kernel.org Signed-off-by: David Hildenbrand --- arch/s390/numa/numa.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/s390/numa/numa.c b/arch/s390/numa/numa.c index 06a80434cfe6..8902652ab3e5 100644 --- a/arch/s390/numa/numa.c +++ b/arch/s390/numa/numa.c @@ -44,6 +44,18 @@ int numa_pfn_to_nid(unsigned long pfn) return mode->__pfn_to_nid ? mode->__pfn_to_nid(pfn) : 0; } +#ifdef CONFIG_MEMORY_HOTPLUG +int memory_add_physaddr_to_nid(u64 addr) +{ + int nid = numa_pfn_to_nid(PFN_DOWN(addr)); + + if (nid < 0) + return 0; + return nid; +} +EXPORT_SYMBOL(memory_add_physaddr_to_nid); +#endif + void numa_update_cpu_topology(void) { if (mode->update_cpu_topology)