From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: [QUESTION] ehea memory notifier Date: Thu, 17 May 2018 15:38:30 +0200 Message-ID: <939f982a-a720-f885-63e3-3ed2a5a2f93f@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, "David S. Miller" To: Douglas Miller Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53432 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750779AbeEQNib (ORCPT ); Thu, 17 May 2018 09:38:31 -0400 Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Hi, looking at the ehea_mem_notifier() and called functions, I wonder if it can tolerate addresses and sizes that are not aligned to EHEA_SECTSIZE. Looks like for MEM_ONLINE/MEM_GOING_OFFLINE ehea_update_busmap() will do nothing in case we don't span at least one EHEA_SECTSIZE. This implies, that for onlined/offlined memory with unaligned address/size, we won't mark the usmap entry valid. start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; end_section = start_section + ((nr_pages * PAGE_SIZE) / EHEA_SECTSIZE) ... for (i = start_section; i < end_section; i++) { ... } The other way around, if we onlined e.g. 16GB and marked the entry valid, we won't mark it invalid if e.g. offlining 8GB of that. Is this the right thing to do? Especially - is "valid of partially online sections" bad? - is "invalid of partially online sections" bad? (working on paravirtualized memory devices that will be able to online/offline things that would not be possible on real HW and checking all memory notifiers) Thanks! -- Thanks, David / dhildenb