From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Date: Tue, 10 Dec 2019 10:09:46 +0000 Subject: Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory() Message-Id: <6da2b279-6a6d-d89c-a34c-962ed021d91d@redhat.com> List-Id: References: <20191209191346.5197-1-logang@deltatee.com> <20191209191346.5197-6-logang@deltatee.com> <20191210100432.GC10404@dhcp22.suse.cz> In-Reply-To: <20191210100432.GC10404@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michal Hocko , Dan Williams Cc: Thomas Gleixner , linux-s390 , linux-ia64@vger.kernel.org, Will Deacon , Linux-sh , Peter Zijlstra , Logan Gunthorpe , Dave Hansen , Linux Kernel Mailing List , platform-driver-x86@vger.kernel.org, Linux MM , Ingo Molnar , Benjamin Herrenschmidt , Andy Lutomirski , Catalin Marinas , Borislav Petkov , Andrew Morton , linuxppc-dev , Christoph Hellwig , Linux ARM On 10.12.19 11:04, Michal Hocko wrote: > On Mon 09-12-19 12:43:40, Dan Williams wrote: >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >>> >>> >>> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>>> On 09.12.19 20:13, Logan Gunthorpe wrote: > [...] >>>>> #ifdef CONFIG_MEMORY_HOTPLUG >>>>> -int arch_add_memory(int nid, u64 start, u64 size, >>>>> +int arch_add_memory(int nid, u64 start, u64 size, pgprot_t prot, >>>>> struct mhp_restrictions *restrictions) >>>> >>>> Can we fiddle that into "struct mhp_restrictions" instead? >>> >>> Yes, if that's what people want, it's pretty trivial to do. I chose not >>> to do it that way because it doesn't get passed down to add_pages() and >>> it's not really a "restriction". If I don't hear any objections, I will >>> do that for v2. >> >> +1 to storing this information alongside the altmap in that structure. >> However, I agree struct mhp_restrictions, with the MHP_MEMBLOCK_API >> flag now gone, has lost all of its "restrictions". How about dropping >> the 'flags' property and renaming the struct to 'struct >> mhp_modifiers'? > > Hmm, this email somehow didn't end up in my inbox so I have missed it > before replying. > > Well, mhp_modifiers makes some sense and it would reduce the API > proliferation but how do you expect the prot part to be handled? > I really do not want people to think about PAGE_KERNEL or which > protection to use because my experience tells that this will get copied > without much thinking or simply will break with some odd usecases. > So how exactly this would be used? I was thinking about exactly the same "issue". 1. default initialization via a function memhp_modifier_default_init(&modified); 2. a flag that unlocks the prot field (default:0). Without the flag, it is ignored. We can keep the current initialization then. Other ideas? -- Thanks, David / dhildenb From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4F7CC2D0C4 for ; Tue, 10 Dec 2019 10:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 811D42077B for ; Tue, 10 Dec 2019 10:10:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iGQnNKgT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727299AbfLJKKC (ORCPT ); Tue, 10 Dec 2019 05:10:02 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:48116 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727149AbfLJKKB (ORCPT ); Tue, 10 Dec 2019 05:10:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575972600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=v3NGxEioBAM2Z0unmIijntydgEaz/erFCSWjh/UwusQ=; b=iGQnNKgTd2+yp6jowmKl8VSevSCFIH1e3gg5A+SOdPLGvhiIqwjJDadojL7ulfC7pxrvqg C6zQ9kqkgLSP2ReBQI24POtSir/fw5FQfdJJSQHrw6nUvcnCGh32jYklK8YEuP2yhd4nRh kR5bGO7OQ6k+hsmHwiWEwEbl1x3RFpA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-K8SsI06KMaeNStx8_04beQ-1; Tue, 10 Dec 2019 05:09:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27D681005512; Tue, 10 Dec 2019 10:09:53 +0000 (UTC) Received: from [10.36.117.222] (ovpn-117-222.ams2.redhat.com [10.36.117.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB17C1001B07; Tue, 10 Dec 2019 10:09:47 +0000 (UTC) Subject: Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory() To: Michal Hocko , Dan Williams Cc: Logan Gunthorpe , Linux Kernel Mailing List , Linux ARM , linux-ia64@vger.kernel.org, linuxppc-dev , linux-s390 , Linux-sh , platform-driver-x86@vger.kernel.org, Linux MM , Christoph Hellwig , Andrew Morton , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra References: <20191209191346.5197-1-logang@deltatee.com> <20191209191346.5197-6-logang@deltatee.com> <20191210100432.GC10404@dhcp22.suse.cz> From: David Hildenbrand Autocrypt: addr=david@redhat.com; prefer-encrypt=mutual; keydata= mQINBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABtCREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT6JAlgEEwEIAEICGwMFCQlmAYAGCwkIBwMCBhUI AgkKCwQWAgMBAh4BAheAFiEEG9nKrXNcTDpGDfzKTd4Q9wD/g1oFAl3pImkCGQEACgkQTd4Q 9wD/g1o+VA//SFvIHUAvul05u6wKv/pIR6aICPdpF9EIgEU448g+7FfDgQwcEny1pbEzAmiw zAXIQ9H0NZh96l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r6XQVRH4+5N6eHZiaeYtFOujp5n+pjBaQK7wUUjDilPQ5QMzIuCL4YjVoylWiBNknvQWBXS lQCWmavOT9sttGQXdPCC5ynI+1ymZC1ORZKANLnRAb0NH/UCzcsstw2TAkFnMEbo9Zu9w7Kv AxBQXWeXhJI9XQssfrf4Gusdqx8nPEpfOqCtbbwJMATbHyqLt7/oz/5deGuwxgb65pWIzufa N7eop7uh+6bezi+rugUI+w6DABEBAAGJAiUEGAECAA8FAlXLn5ECGwwFCQlmAYAACgkQTd4Q 9wD/g1qA6w/+M+ggFv+JdVsz5+ZIc6MSyGUozASX+bmIuPeIecc9UsFRatc91LuJCKMkD9Uv GOcWSeFpLrSGRQ1Z7EMzFVU//qVs6uzhsNk0RYMyS0B6oloW3FpyQ+zOVylFWQCzoyyf227y GW8HnXunJSC+4PtlL2AY4yZjAVAPLK2l6mhgClVXTQ/S7cBoTQKP+jvVJOoYkpnFxWE9pn4t H5QIFk7Ip8TKr5k3fXVWk4lnUi9MTF/5L/mWqdyIO1s7cjharQCstfWCzWrVeVctpVoDfJWp 4LwTuQ5yEM2KcPeElLg5fR7WB2zH97oI6/Ko2DlovmfQqXh9xWozQt0iGy5tWzh6I0JrlcxJ ileZWLccC4XKD1037Hy2FLAjzfoWgwBLA6ULu0exOOdIa58H4PsXtkFPrUF980EEibUp0zFz GotRVekFAceUaRvAj7dh76cToeZkfsjAvBVb4COXuhgX6N4pofgNkW2AtgYu1nUsPAo+NftU CxrhjHtLn4QEBpkbErnXQyMjHpIatlYGutVMS91XTQXYydCh5crMPs7hYVsvnmGHIaB9ZMfB njnuI31KBiLUks+paRkHQlFcgS2N3gkRBzH7xSZ+t7Re3jvXdXEzKBbQ+dC3lpJB0wPnyMcX FOTT3aZT7IgePkt5iC/BKBk3hqKteTnJFeVIT7EC+a6YUFg= Organization: Red Hat GmbH Message-ID: <6da2b279-6a6d-d89c-a34c-962ed021d91d@redhat.com> Date: Tue, 10 Dec 2019 11:09:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191210100432.GC10404@dhcp22.suse.cz> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: K8SsI06KMaeNStx8_04beQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10.12.19 11:04, Michal Hocko wrote: > On Mon 09-12-19 12:43:40, Dan Williams wrote: >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >>> >>> >>> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>>> On 09.12.19 20:13, Logan Gunthorpe wrote: > [...] >>>>> #ifdef CONFIG_MEMORY_HOTPLUG >>>>> -int arch_add_memory(int nid, u64 start, u64 size, >>>>> +int arch_add_memory(int nid, u64 start, u64 size, pgprot_t prot, >>>>> struct mhp_restrictions *restrictions) >>>> >>>> Can we fiddle that into "struct mhp_restrictions" instead? >>> >>> Yes, if that's what people want, it's pretty trivial to do. I chose not >>> to do it that way because it doesn't get passed down to add_pages() and >>> it's not really a "restriction". If I don't hear any objections, I will >>> do that for v2. >> >> +1 to storing this information alongside the altmap in that structure. >> However, I agree struct mhp_restrictions, with the MHP_MEMBLOCK_API >> flag now gone, has lost all of its "restrictions". How about dropping >> the 'flags' property and renaming the struct to 'struct >> mhp_modifiers'? > > Hmm, this email somehow didn't end up in my inbox so I have missed it > before replying. > > Well, mhp_modifiers makes some sense and it would reduce the API > proliferation but how do you expect the prot part to be handled? > I really do not want people to think about PAGE_KERNEL or which > protection to use because my experience tells that this will get copied > without much thinking or simply will break with some odd usecases. > So how exactly this would be used? I was thinking about exactly the same "issue". 1. default initialization via a function memhp_modifier_default_init(&modified); 2. a flag that unlocks the prot field (default:0). Without the flag, it is ignored. We can keep the current initialization then. Other ideas? -- Thanks, David / dhildenb From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory() Date: Tue, 10 Dec 2019 11:09:46 +0100 Message-ID: <6da2b279-6a6d-d89c-a34c-962ed021d91d@redhat.com> References: <20191209191346.5197-1-logang@deltatee.com> <20191209191346.5197-6-logang@deltatee.com> <20191210100432.GC10404@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20191210100432.GC10404@dhcp22.suse.cz> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Michal Hocko , Dan Williams Cc: Logan Gunthorpe , Linux Kernel Mailing List , Linux ARM , linux-ia64@vger.kernel.org, linuxppc-dev , linux-s390 , Linux-sh , platform-driver-x86@vger.kernel.org, Linux MM , Christoph Hellwig , Andrew Morton , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter List-Id: platform-driver-x86.vger.kernel.org On 10.12.19 11:04, Michal Hocko wrote: > On Mon 09-12-19 12:43:40, Dan Williams wrote: >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >>> >>> >>> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>>> On 09.12.19 20:13, Logan Gunthorpe wrote: > [...] >>>>> #ifdef CONFIG_MEMORY_HOTPLUG >>>>> -int arch_add_memory(int nid, u64 start, u64 size, >>>>> +int arch_add_memory(int nid, u64 start, u64 size, pgprot_t prot, >>>>> struct mhp_restrictions *restrictions) >>>> >>>> Can we fiddle that into "struct mhp_restrictions" instead? >>> >>> Yes, if that's what people want, it's pretty trivial to do. I chose not >>> to do it that way because it doesn't get passed down to add_pages() and >>> it's not really a "restriction". If I don't hear any objections, I will >>> do that for v2. >> >> +1 to storing this information alongside the altmap in that structure. >> However, I agree struct mhp_restrictions, with the MHP_MEMBLOCK_API >> flag now gone, has lost all of its "restrictions". How about dropping >> the 'flags' property and renaming the struct to 'struct >> mhp_modifiers'? > > Hmm, this email somehow didn't end up in my inbox so I have missed it > before replying. > > Well, mhp_modifiers makes some sense and it would reduce the API > proliferation but how do you expect the prot part to be handled? > I really do not want people to think about PAGE_KERNEL or which > protection to use because my experience tells that this will get copied > without much thinking or simply will break with some odd usecases. > So how exactly this would be used? I was thinking about exactly the same "issue". 1. default initialization via a function memhp_modifier_default_init(&modified); 2. a flag that unlocks the prot field (default:0). Without the flag, it is ignored. We can keep the current initialization then. Other ideas? -- Thanks, David / dhildenb From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0C61C43603 for ; Tue, 10 Dec 2019 10:12:09 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 920402073D for ; Tue, 10 Dec 2019 10:12:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Gtd3mkW2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 920402073D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47XG7q40NSzDqV8 for ; Tue, 10 Dec 2019 21:12:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=207.211.31.81; helo=us-smtp-delivery-1.mimecast.com; envelope-from=david@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Gtd3mkW2"; dkim-atps=neutral Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47XG5T3mDWzDqTG for ; Tue, 10 Dec 2019 21:10:04 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575972601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=v3NGxEioBAM2Z0unmIijntydgEaz/erFCSWjh/UwusQ=; b=Gtd3mkW2yI1xRn8Eq1c+7zA+ADYTfuJUS6o9+tiHoxPX3teTx3QY7WOj8aneuJS18iJn99 W/QXUAoz4PZx92uOu1hTPFx2X1a/CF87u0eZKT00Wvn+dUbw8xg4x3jqRGVavSxuiAT9Lt K6yFOIUV7+myg4+hAVovPdQQNbLmyK4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-K8SsI06KMaeNStx8_04beQ-1; Tue, 10 Dec 2019 05:09:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27D681005512; Tue, 10 Dec 2019 10:09:53 +0000 (UTC) Received: from [10.36.117.222] (ovpn-117-222.ams2.redhat.com [10.36.117.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB17C1001B07; Tue, 10 Dec 2019 10:09:47 +0000 (UTC) Subject: Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory() To: Michal Hocko , Dan Williams References: <20191209191346.5197-1-logang@deltatee.com> <20191209191346.5197-6-logang@deltatee.com> <20191210100432.GC10404@dhcp22.suse.cz> From: David Hildenbrand Autocrypt: addr=david@redhat.com; prefer-encrypt=mutual; keydata= mQINBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmr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WgwBLA6ULu0exOOdIa58H4PsXtkFPrUF980EEibUp0zFz GotRVekFAceUaRvAj7dh76cToeZkfsjAvBVb4COXuhgX6N4pofgNkW2AtgYu1nUsPAo+NftU CxrhjHtLn4QEBpkbErnXQyMjHpIatlYGutVMS91XTQXYydCh5crMPs7hYVsvnmGHIaB9ZMfB njnuI31KBiLUks+paRkHQlFcgS2N3gkRBzH7xSZ+t7Re3jvXdXEzKBbQ+dC3lpJB0wPnyMcX FOTT3aZT7IgePkt5iC/BKBk3hqKteTnJFeVIT7EC+a6YUFg= Organization: Red Hat GmbH Message-ID: <6da2b279-6a6d-d89c-a34c-962ed021d91d@redhat.com> Date: Tue, 10 Dec 2019 11:09:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191210100432.GC10404@dhcp22.suse.cz> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: K8SsI06KMaeNStx8_04beQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , linux-s390 , linux-ia64@vger.kernel.org, Will Deacon , Linux-sh , Peter Zijlstra , Logan Gunthorpe , Dave Hansen , Linux Kernel Mailing List , platform-driver-x86@vger.kernel.org, Linux MM , Ingo Molnar , Andy Lutomirski , Catalin Marinas , Borislav Petkov , Andrew Morton , linuxppc-dev , Christoph Hellwig , Linux ARM Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 10.12.19 11:04, Michal Hocko wrote: > On Mon 09-12-19 12:43:40, Dan Williams wrote: >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >>> >>> >>> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>>> On 09.12.19 20:13, Logan Gunthorpe wrote: > [...] >>>>> #ifdef CONFIG_MEMORY_HOTPLUG >>>>> -int arch_add_memory(int nid, u64 start, u64 size, >>>>> +int arch_add_memory(int nid, u64 start, u64 size, pgprot_t prot, >>>>> struct mhp_restrictions *restrictions) >>>> >>>> Can we fiddle that into "struct mhp_restrictions" instead? >>> >>> Yes, if that's what people want, it's pretty trivial to do. I chose not >>> to do it that way because it doesn't get passed down to add_pages() and >>> it's not really a "restriction". If I don't hear any objections, I will >>> do that for v2. >> >> +1 to storing this information alongside the altmap in that structure. >> However, I agree struct mhp_restrictions, with the MHP_MEMBLOCK_API >> flag now gone, has lost all of its "restrictions". How about dropping >> the 'flags' property and renaming the struct to 'struct >> mhp_modifiers'? > > Hmm, this email somehow didn't end up in my inbox so I have missed it > before replying. > > Well, mhp_modifiers makes some sense and it would reduce the API > proliferation but how do you expect the prot part to be handled? > I really do not want people to think about PAGE_KERNEL or which > protection to use because my experience tells that this will get copied > without much thinking or simply will break with some odd usecases. > So how exactly this would be used? I was thinking about exactly the same "issue". 1. default initialization via a function memhp_modifier_default_init(&modified); 2. a flag that unlocks the prot field (default:0). Without the flag, it is ignored. We can keep the current initialization then. Other ideas? -- Thanks, David / dhildenb From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50BABC2D0BF for ; Tue, 10 Dec 2019 10:10:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 232A32073D for ; Tue, 10 Dec 2019 10:10:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U3oyxY1H"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Gtd3mkW2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 232A32073D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QHE3oWeRPbnsJTQq1T1qY/A5C+39257KsKcI+8rlpM8=; b=U3oyxY1H7rL8dg 1df4RJU+630dkySnLRB4uCqyBJJ/bes6VUZqBJNKVISu4w6BvL2LBGD4sYlu52UbbxZGiT3DuDxTv PHVdxPAqCs8UOLnBClOe0lFhheP5hjFDph6uwb2xSFw7dWP1WQWcwy7s0VtwSQ/dscV6pvxvxoLsQ Fu97RX1uo+9gd3ovJU9+djvM+GqCiJ0F4vGip6R+hSa9lquZG0hhQ5KRV6jqoUBLZmGjOYbiBDXZZ 0GIHIPARM4cTZSc4xnQANi4Tj7p76eO5vcCOSh7WjaT84aaCag9grIQG+wSvP7pOrtTCL25SwqiIr 3+c50zkUwTUNZyWMm+Eg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iecT2-0004uk-AP; Tue, 10 Dec 2019 10:10:08 +0000 Received: from us-smtp-1.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iecSx-0003zU-VW for linux-arm-kernel@lists.infradead.org; Tue, 10 Dec 2019 10:10:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575972601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=v3NGxEioBAM2Z0unmIijntydgEaz/erFCSWjh/UwusQ=; b=Gtd3mkW2yI1xRn8Eq1c+7zA+ADYTfuJUS6o9+tiHoxPX3teTx3QY7WOj8aneuJS18iJn99 W/QXUAoz4PZx92uOu1hTPFx2X1a/CF87u0eZKT00Wvn+dUbw8xg4x3jqRGVavSxuiAT9Lt K6yFOIUV7+myg4+hAVovPdQQNbLmyK4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-K8SsI06KMaeNStx8_04beQ-1; Tue, 10 Dec 2019 05:09:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27D681005512; Tue, 10 Dec 2019 10:09:53 +0000 (UTC) Received: from [10.36.117.222] (ovpn-117-222.ams2.redhat.com [10.36.117.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB17C1001B07; Tue, 10 Dec 2019 10:09:47 +0000 (UTC) Subject: Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory() To: Michal Hocko , Dan Williams References: <20191209191346.5197-1-logang@deltatee.com> <20191209191346.5197-6-logang@deltatee.com> <20191210100432.GC10404@dhcp22.suse.cz> From: David Hildenbrand Autocrypt: addr=david@redhat.com; prefer-encrypt=mutual; keydata= mQINBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABtCREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT6JAlgEEwEIAEICGwMFCQlmAYAGCwkIBwMCBhUI AgkKCwQWAgMBAh4B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FOTT3aZT7IgePkt5iC/BKBk3hqKteTnJFeVIT7EC+a6YUFg= Organization: Red Hat GmbH Message-ID: <6da2b279-6a6d-d89c-a34c-962ed021d91d@redhat.com> Date: Tue, 10 Dec 2019 11:09:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191210100432.GC10404@dhcp22.suse.cz> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: K8SsI06KMaeNStx8_04beQ-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_021004_104538_E28A1B06 X-CRM114-Status: GOOD ( 16.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , linux-s390 , linux-ia64@vger.kernel.org, Will Deacon , Linux-sh , Peter Zijlstra , Logan Gunthorpe , Dave Hansen , Linux Kernel Mailing List , platform-driver-x86@vger.kernel.org, Linux MM , Ingo Molnar , Benjamin Herrenschmidt , Andy Lutomirski , Catalin Marinas , Borislav Petkov , Andrew Morton , linuxppc-dev , Christoph Hellwig , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10.12.19 11:04, Michal Hocko wrote: > On Mon 09-12-19 12:43:40, Dan Williams wrote: >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >>> >>> >>> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>>> On 09.12.19 20:13, Logan Gunthorpe wrote: > [...] >>>>> #ifdef CONFIG_MEMORY_HOTPLUG >>>>> -int arch_add_memory(int nid, u64 start, u64 size, >>>>> +int arch_add_memory(int nid, u64 start, u64 size, pgprot_t prot, >>>>> struct mhp_restrictions *restrictions) >>>> >>>> Can we fiddle that into "struct mhp_restrictions" instead? >>> >>> Yes, if that's what people want, it's pretty trivial to do. I chose not >>> to do it that way because it doesn't get passed down to add_pages() and >>> it's not really a "restriction". If I don't hear any objections, I will >>> do that for v2. >> >> +1 to storing this information alongside the altmap in that structure. >> However, I agree struct mhp_restrictions, with the MHP_MEMBLOCK_API >> flag now gone, has lost all of its "restrictions". How about dropping >> the 'flags' property and renaming the struct to 'struct >> mhp_modifiers'? > > Hmm, this email somehow didn't end up in my inbox so I have missed it > before replying. > > Well, mhp_modifiers makes some sense and it would reduce the API > proliferation but how do you expect the prot part to be handled? > I really do not want people to think about PAGE_KERNEL or which > protection to use because my experience tells that this will get copied > without much thinking or simply will break with some odd usecases. > So how exactly this would be used? I was thinking about exactly the same "issue". 1. default initialization via a function memhp_modifier_default_init(&modified); 2. a flag that unlocks the prot field (default:0). Without the flag, it is ignored. We can keep the current initialization then. Other ideas? -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel