[PATCH v15 11/11] secretmem: test: add basic selftest for memfd_secret(2)

2021-01-20 Thread Mike Rapoport
From: Mike Rapoport The test verifies that file descriptor created with memfd_secret does not allow read/write operations, that secret memory mappings respect RLIMIT_MEMLOCK and that remote accesses with process_vm_read() and ptrace() to the secret memory fail. Signed-off-by: Mike Rapoport Cc

[PATCH v15 10/11] arch, mm: wire up memfd_secret system call where relevant

2021-01-20 Thread Mike Rapoport
From: Mike Rapoport Wire up memfd_secret system call on architectures that define ARCH_HAS_SET_DIRECT_MAP, namely arm64, risc-v and x86. Signed-off-by: Mike Rapoport Acked-by: Palmer Dabbelt Acked-by: Arnd Bergmann Cc: Alexander Viro Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Catalin

[PATCH v15 09/11] PM: hibernate: disable when there are active secretmem users

2021-01-20 Thread Mike Rapoport
From: Mike Rapoport It is unsafe to allow saving of secretmem areas to the hibernation snapshot as they would be visible after the resume and this essentially will defeat the purpose of secret memory mappings. Prevent hibernation whenever there are active secret memory users. Signed-off

[PATCH v15 04/11] set_memory: allow set_direct_map_*_noflush() for multiple pages

2021-01-20 Thread Mike Rapoport
From: Mike Rapoport The underlying implementations of set_direct_map_invalid_noflush() and set_direct_map_default_noflush() allow updating multiple contiguous pages at once. Add numpages parameter to set_direct_map_*_noflush() to expose this ability with these APIs. Signed-off-by: Mike

[PATCH v15 05/11] set_memory: allow querying whether set_direct_map_*() is actually enabled

2021-01-20 Thread Mike Rapoport
From: Mike Rapoport On arm64, set_direct_map_*() functions may return 0 without actually changing the linear map. This behaviour can be controlled using kernel parameters, so we need a way to determine at runtime whether calls to set_direct_map_invalid_noflush

[PATCH v15 00/11] mm: introduce memfd_secret system call to create "secret" memory areas

2021-01-20 Thread Mike Rapoport
From: Mike Rapoport Hi, @Andrew, this is based on v5.11-rc4-mmots-2021-01-19-13-54 with secretmem patches dropped from there, I can rebase whatever way you prefer. This is an implementation of "secret" mappings backed by a file descriptor. The file descriptor backing secret memor

Re: [PATCH v14 05/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-01-20 Thread Mike Rapoport
On Wed, Jan 20, 2021 at 04:02:10PM +, Matthew Wilcox wrote: > On Wed, Jan 20, 2021 at 05:05:10PM +0200, Mike Rapoport wrote: > > On Tue, Jan 19, 2021 at 08:22:13PM +, Matthew Wilcox wrote: > > > On Thu, Dec 03, 2020 at 08:29:44AM +0200, Mike Rapoport wrote: > >

Re: [PATCH v14 05/10] mm: introduce memfd_secret system call to create "secret" memory areas

2021-01-20 Thread Mike Rapoport
On Tue, Jan 19, 2021 at 08:22:13PM +, Matthew Wilcox wrote: > On Thu, Dec 03, 2020 at 08:29:44AM +0200, Mike Rapoport wrote: > > +static vm_fault_t secretmem_fault(struct vm_fault *vmf) > > +{ > > + struct address_space *mapping = vmf->vma->vm_file->f_mappin

Re: [PATCH v6 1/2] dt-bindings: iio: accel: Add bmi088 accelerometer bindings

2021-01-19 Thread Mike Looijmans
Wow, fast response, thanks. Updated my dtschema, fixed the match name as requested and v7 is ready to go. I'm awaiting feedback from the iio people so I can send a new patch set. M. Met vriendelijke groet / kind regards, Mike Looijmans System Expert TOPIC Embedded Products B.V

[PATCH v2 3/5] hugetlb: only set HPageMigratable for migratable hstates

2021-01-19 Thread Mike Kravetz
will not be isolated and no attempt will be made to migrate. We should never get to unmap_and_move_huge_page for a page where migration is not supported, so throw a warning if we do. Signed-off-by: Mike Kravetz --- fs/hugetlbfs/inode.c| 2 +- include/linux/hugetlb.h | 9 + mm/hugetlb.c

[PATCH v2 2/5] hugetlb: convert page_huge_active() HPageMigratable flag

2021-01-19 Thread Mike Kravetz
race with code freeing the page. The extra check in page_huge_active shortened the race window, but did not prevent the race. Offline code calling scan_movable_pages already deals with these races, so removing the check is acceptable. Add comment to racy code. Signed-off-by: Mike Kravetz --- fs

[PATCH v2 5/5] hugetlb: convert PageHugeFreed to HPageFreed flag

2021-01-19 Thread Mike Kravetz
Use new hugetlb specific HPageFreed flag to replace the PageHugeFreed interfaces. Signed-off-by: Mike Kravetz --- include/linux/hugetlb.h | 3 +++ mm/hugetlb.c| 23 --- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/include/linux/hugetlb.h b

[PATCH v2 0/5] create hugetlb flags to consolidate state

2021-01-19 Thread Mike Kravetz
hanged subpool routine names (Matthew) More comments in code (Oscar) Based on v5.11-rc3-mmotm-2021-01-12-01-57 Mike Kravetz (5): hugetlb: use page.private for hugetlb specific page flags hugetlb: convert page_huge_active() HPageMigratable flag hugetlb: only set HPageMigratable for migratable h

[PATCH v2 1/5] hugetlb: use page.private for hugetlb specific page flags

2021-01-19 Thread Mike Kravetz
information will happen in subsequent patches. Signed-off-by: Mike Kravetz --- fs/hugetlbfs/inode.c| 12 ++- include/linux/hugetlb.h | 72 + mm/hugetlb.c| 45 +- 3 files changed, 97 insertions(+), 32 deletions(-) diff

[PATCH v2 4/5] hugetlb: convert PageHugeTemporary() to HPageTemporary flag

2021-01-19 Thread Mike Kravetz
Use new hugetlb specific HPageTemporary flag to replace the PageHugeTemporary() interfaces. Signed-off-by: Mike Kravetz --- include/linux/hugetlb.h | 6 ++ mm/hugetlb.c| 36 +++- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git

Re: [RFC PATCH 00/37] block: introduce bio_init_fields()

2021-01-19 Thread Mike Snitzer
field to set would create a cascade of churn throughout kernel (and invariably many callers won't need the new field initialized, so you keep passing 0 for more and more fields). Nacked-by: Mike Snitzer

Re: [PATCH v2] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call

2021-01-19 Thread Mike Kravetz
Miaohe Lin >> >> I would avoid mentioning gbl_reserve as not all callers use it, and focus >> on what delta means: >> >> "When reservation accounting remains unchanged..", but anyway: > > Sounds good. Maybe Andrew could kindly do this if this patch is picked up ? Thank you and Andrew. Looks like Andrew updated the commit message and added to his tree. -- Mike Kravetz

Re: [PATCH v2] hugetlbfs: Remove useless BUG_ON(!inode) in hugetlbfs_setattr()

2021-01-19 Thread Mike Kravetz
-- > fs/hugetlbfs/inode.c | 2 -- > 1 file changed, 2 deletions(-) Thanks, Reviewed-by: Mike Kravetz -- Mike Kravetz > > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c > index 016c863b493b..79464963f95e 100644 > --- a/fs/hugetlbfs/inode.c > +++ b/fs/hugetlbfs/i

Re: [PATCH] hugetlbfs: remove meaningless variable avoid_reserve

2021-01-19 Thread Mike Kravetz
s with * reserves for the file at the inode level. If we fallocate * pages in these areas, we need to consume the reserves * to keep reservation accounting consistent. */ -- Mike Kravetz > - page = alloc_hug

Re: [PATCH] hugetlbfs: Use helper macro default_hstate in init_hugetlbfs_fs

2021-01-19 Thread Mike Kravetz
f-by: Miaohe Lin Thanks, Reviewed-by: Mike Kravetz -- Mike Kravetz > --- > fs/hugetlbfs/inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c > index 9b221b87fbea..88751e35e69d 100644 > --- a/fs/hugetlbfs/ino

[PATCH v3] perf: cs-etm: update ETM metadata format

2021-01-19 Thread Mike Leach
-off-by: Mike Leach --- tools/perf/arch/arm/util/cs-etm.c | 7 +- tools/perf/util/cs-etm.c | 235 -- tools/perf/util/cs-etm.h | 30 +++- 3 files changed, 223 insertions(+), 49 deletions(-) diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf

Re: [PATCH v2] hugetlbfs: correct obsolete function name in hugetlbfs_read_iter()

2021-01-19 Thread Mike Kravetz
t; to generic_file_buffered_read(). So replace do_generic_mapping_read() with > generic_file_buffered_read() to keep comment uptodate. > > Signed-off-by: Miaohe Lin > --- > fs/hugetlbfs/inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, Reviewed-by: Mik

Re: [PATCH] hugetlbfs: Use helper macro default_hstate in init_hugetlbfs_fs

2021-01-19 Thread Mike Kravetz
CC Andrew On 1/19/21 9:53 AM, Mike Kravetz wrote: > On 1/16/21 1:18 AM, Miaohe Lin wrote: >> Since commit e5ff215941d5 ("hugetlb: multiple hstates for multiple page >> sizes"), we can use macro default_hstate to get the struct hstate which >> we use by default.

[PATCH v6 2/2] iio: accel: Add support for the Bosch-Sensortec BMI088

2021-01-19 Thread Mike Looijmans
The BMI088 is a combined module with both accelerometer and gyroscope. This adds the accelerometer driver support for the SPI interface. The gyroscope part is already supported by the BMG160 driver. Signed-off-by: Mike Looijmans --- Changes in v6: Hope you have good memory - v5 was almost

[PATCH v6 1/2] dt-bindings: iio: accel: Add bmi088 accelerometer bindings

2021-01-19 Thread Mike Looijmans
This adds the device-tree bindings for the Bosch Sensortec BMI088 IMU, the accelerometer part. Signed-off-by: Mike Looijmans --- Changes in v6: I't been almost a year since the last commit, sorry... Fixed the yaml errors Add interrupt, vdd and vddio properties Changes in v5: submit together

Re: [PATCH v2] perf: cs-etm: update ETM metadata format

2021-01-19 Thread Mike Leach
Hi Mathieu, On Mon, 18 Jan 2021 at 19:06, Mathieu Poirier wrote: > > Hey Mike, > > On Fri, Jan 15, 2021 at 05:27:02PM +, Mike Leach wrote: > > The current fixed metadata version format (version 0), means that adding > > metadata parameter items renders files from a

[PATCH] nitro_enclaves: set master in the procedure of NE probe

2021-01-18 Thread Longpeng(Mike)
to be PCI conformant. Signed-off-by: Longpeng(Mike) --- drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.c b/drivers/virt/nitro_enclaves/ne_pci_dev.c index b9c1de4..143207e 100644 --- a/drivers/virt/nitro_enclaves

Re: [PATCH] iscsi: Do Not set param when sock is NULL

2021-01-18 Thread Mike Christie
On 1/7/21 9:48 AM, Gulam Mohamed wrote: > Hi Michael, > > As per your suggestions in below mail, I have completed the > suggested changes and tested them. Can you please review and let me know your > comments? Here is the patch: > > Description > === > 1. This Kernel panic

Re: [PATCH V2] coresight: etm4x: add AMBA id for Cortex-A55 and Cortex-A75

2021-01-18 Thread Mike Leach
0x000bbd0c, uci_id_etm4),/* Neoverse N1 */ > CS_AMBA_UCI_ID(0x000f0205, uci_id_etm4),/* Qualcomm Kryo */ > CS_AMBA_UCI_ID(0x000f0211, uci_id_etm4),/* Qualcomm Kryo */ > -- > 2.25.1 > Reviewed by: Mike Leach -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK

[GIT PULL] ia64: fix build regression

2021-01-18 Thread Mike Rapoport
Mike Rapoport (1): ia64: fix build failure caused by memory model changes arch/ia64/include/asm/sparsemem.h | 1 + 1 file changed, 1 insertion(+) -- Sincerely yours, Mike.

Re: [PATCH 2/5] hugetlb: convert page_huge_active() to HP_Migratable flag

2021-01-16 Thread Mike Kravetz
s need to be set/tested outside hugetlb code, so > it indeed looks nicer and more consistent to follow page-flags.h convention. > > Sorry for the noise. Thanks everyone! I was unsure about the best way to go for this. Will send out a new version in a few days using the page-flag style macros. -- Mike Kravetz

[PATCH 2/5] hugetlb: convert page_huge_active() to HP_Migratable flag

2021-01-15 Thread Mike Kravetz
with code freeing the page. The extra check in page_huge_active shortened the race window, but did not prevent the race. Offline code calling scan_movable_pages already deals with these races, so removing the check is acceptable. Signed-off-by: Mike Kravetz --- fs/hugetlbfs/inode.c | 2

[PATCH 1/5] hugetlb: use page.private for hugetlb specific page flags

2021-01-15 Thread Mike Kravetz
patches. Signed-off-by: Mike Kravetz --- fs/hugetlbfs/inode.c| 12 ++-- include/linux/hugetlb.h | 61 + mm/hugetlb.c| 46 +++ 3 files changed, 87 insertions(+), 32 deletions(-) diff --git a/fs/hugetlbfs/inode.c b

[PATCH 0/5] create hugetlb flags to consolidate state

2021-01-15 Thread Mike Kravetz
set of flag manipulation routines (Oscar) Moved flags and routines to hugetlb.h (Muchun) Changed format of page flag names (Muchun) Changed subpool routine names (Matthew) More comments in code (Oscar) Based on v5.11-rc3-mmotm-2021-01-12-01-57 Mike Kravetz (5): hugetlb: use page.priv

[PATCH 5/5] hugetlb: convert PageHugeFreed to HP_Freed flag

2021-01-15 Thread Mike Kravetz
Use new hugetlb specific flag HP_Freed flag to replace the PageHugeFreed interfaces. Signed-off-by: Mike Kravetz --- include/linux/hugetlb.h | 2 ++ mm/hugetlb.c| 23 --- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/include/linux/hugetlb.h b

[PATCH 4/5] hugetlb: convert PageHugeTemporary() to HP_Temporary flag

2021-01-15 Thread Mike Kravetz
Use new hugetlb specific flag HP_Temporary flag to replace the PageHugeTemporary() interfaces. Signed-off-by: Mike Kravetz --- include/linux/hugetlb.h | 5 + mm/hugetlb.c| 36 +++- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git

[PATCH 3/5] hugetlb: only set HP_Migratable for migratable hstates

2021-01-15 Thread Mike Kravetz
necessary. If migration is not supported for the hstate, HP_Migratable will not be set, the page will not be isolated and no attempt will be made to migrate. Signed-off-by: Mike Kravetz --- fs/hugetlbfs/inode.c| 2 +- include/linux/hugetlb.h | 9 + mm/hugetlb.c| 8

Re: [RFC PATCH 2/3] hugetlb: convert page_huge_active() to HPageMigratable flag

2021-01-15 Thread Mike Kravetz
On 1/15/21 12:29 PM, Oscar Salvador wrote: > > About that alloc_contig_range topic, I would like to take a look unless > someone is already on it or about to be. > > Thanks Mike for the time ;-) Feel free. My first thought is that migration of a free hugetlb page would need

Re: [RFC PATCH 2/3] hugetlb: convert page_huge_active() to HPageMigratable flag

2021-01-15 Thread Mike Kravetz
On 1/15/21 9:43 AM, Mike Kravetz wrote: > On 1/15/21 1:17 AM, Oscar Salvador wrote: >> On Mon, Jan 11, 2021 at 01:01:51PM -0800, Mike Kravetz wrote: >>> Use the new hugetlb page specific flag to replace the page_huge_active >>> interfaces. By it's name, page_huge_acti

Re: [RFC PATCH 3/3] hugetlb: convert PageHugeTemporary() to HPageTempSurplus

2021-01-15 Thread Mike Kravetz
On 1/15/21 2:16 AM, Oscar Salvador wrote: > On Mon, Jan 11, 2021 at 01:01:52PM -0800, Mike Kravetz wrote: >> Use new hugetlb specific flag HPageTempSurplus to replace the >> PageHugeTemporary() interfaces. >> >> Signed-off-by: Mike Kravetz &

Re: [RFC PATCH 2/3] hugetlb: convert page_huge_active() to HPageMigratable flag

2021-01-15 Thread Mike Kravetz
On 1/15/21 1:17 AM, Oscar Salvador wrote: > On Mon, Jan 11, 2021 at 01:01:51PM -0800, Mike Kravetz wrote: >> Use the new hugetlb page specific flag to replace the page_huge_active >> interfaces. By it's name, page_huge_active implied that a huge page >> was on the

[PATCH v2] perf: cs-etm: update ETM metadata format

2021-01-15 Thread Mike Leach
functions per version 2. Renamed NR_PARAMs to NR_TRC_PARAMs to emphasise use as count of trace related parameters, not total block parameter. 3. Misc other fixes. Signed-off-by: Mike Leach --- tools/perf/arch/arm/util/cs-etm.c | 7 +- tools/perf/util/cs-etm.c | 212

Re: [PATCH] coresight: etm4x: add AMBA id for Cortex-A55 and Cortex-A75

2021-01-15 Thread Mike Leach
AMBA_ID(0x000bbd0a), /* Cortex-A75 */ This AMBA ID is used for PMU, ETM, debug block and CTI for this core. Please use the CS_AMBA_UCI_ID macro to correctly identify this component. See CoreSight 3.0 Architecture Manual 3.0 (IHI 0029E) section B2.1.2 for an explanation of UCI. Regar

[PATCH 2/2] x86/setup: merge several reservations of start of the memory

2021-01-15 Thread Mike Rapoport
From: Mike Rapoport Currently the first several pages are reserved both to avoid leaking their contents on systems with L1TF and to avoid corrupting BIOS memory. Merge the two memory reservations. Signed-off-by: Mike Rapoport --- arch/x86/kernel/setup.c | 29 +++-- 1

[PATCH 1/2] x86/setup: consolidate early memory reservations

2021-01-15 Thread Mike Rapoport
From: Mike Rapoport The early reservations of memory areas used by the firmware, bootloader, kernel text and data are spread over setup_arch(). Moreover, some of them happen *after* memblock allocations, e.g trim_platform_memory_ranges() and trim_low_memory_range() are called after

[PATCH 0/2] x86/setup: consolidate early memory reservations

2021-01-15 Thread Mike Rapoport
From: Mike Rapoport Hi, David noticed that we do some of memblock_reserve() calls after allocations are possible: https://lore.kernel.org/lkml/6ba6bde3-1520-5cd0-f987-32d543f0b...@redhat.com For now there is no actual problem because in top-down mode we allocate from the end of the memory

Re: [PATCH] perf: cs-etm: update ETM metadata format

2021-01-14 Thread Mike Leach
Hi Leo, On Thu, 14 Jan 2021 at 13:46, Leo Yan wrote: > > Hi Mike, > > On Wed, Jan 13, 2021 at 01:35:04PM +, Mike Leach wrote: > > The current fixed metadata version format (version 0), means that adding > > metadata parameter items renders files from a previous versio

Re: [PATCH] mm/hugetlb: Use helper huge_page_order and pages_per_huge_page

2021-01-14 Thread Mike Kravetz
; use it. > > Signed-off-by: Miaohe Lin > --- > mm/hugetlb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Thanks, Reviewed-by: Mike Kravetz -- Mike Kravetz

Re: [PATCH] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call

2021-01-14 Thread Mike Kravetz
this code path. However, there are other code paths where hugetlb_acct_memory is called with a delta value of 0 as well. I would rather see a simple check at the beginning of hugetlb_acct_memory like. if (!delta) return 0; -- Mike Kravetz >> >> return 0; >> } >> > >

Re: [PATCH v3 5/6] dm: Verify inline encryption capabilities of new table when it is loaded

2021-01-14 Thread Mike Snitzer
rn 0; > +} > + > static void dm_update_keyslot_manager(struct request_queue *q, > struct blk_keyslot_manager *ksm) > { There shouldn't be any need to bolt on ksm verification in terms of a temporary ksm. If you run with my suggestions I just provided in review of patch 3: dm_table_complete()'s setup of the ksm should also implicitly validate it. So this patch, and extra dm_verify_inline_encryption() interface, shouldn't be needed. Mike

Re: [PATCH v3 3/6] dm: add support for passing through inline crypto support

2021-01-14 Thread Mike Snitzer
map = ERR_CAST(ksm); > + goto out; > + } > + The work done in dm_construct_keyslot_manager() is inappropriate to do at this point in the DM core code. This should be split into 2 phases: 1) allocation/setup of ksm in dm-table.c:dm_table_complete() 2) quick install of k

Re: [PATCH v3 2/6] block: keyslot-manager: Introduce functions for device mapper support

2021-01-14 Thread Mike Snitzer
rget_ksm->max_dun_bytes_supported = > + reference_ksm->max_dun_bytes_supported; > +} > +EXPORT_SYMBOL_GPL(blk_ksm_update_capabilities); > + Given the patch header's preamble about FS possibly accessing/checking the existing ksm: without any locking

Re: [PATCH] mm: memblock: remove return value of memblock_free_all()

2021-01-14 Thread Mike Rapoport
to _totalram_pages variable by calling totalram_pages_add(). > > so do not need to return total count of freed pages. > > Signed-off-by: Daeseok Youn Applied to memblock/for-next, thanks! -- Sincerely yours, Mike.

Re: [PATCH] ia64: fix build failure caused by memory model changes

2021-01-14 Thread Mike Rapoport
If there are no objections, I'll take it via the memblock tree. @Tony an ack would be appreciated. On Fri, Dec 18, 2020 at 06:35:50PM +0200, Mike Rapoport wrote: > From: Mike Rapoport > > The change of ia64's default memory model to SPARSEMEM causes defconfig > build to fai

Re: [PATCH] ia64: fix build failure caused by memory model changes

2021-01-14 Thread Mike Rapoport
Andrew, Would you like me to On Fri, Dec 18, 2020 at 06:35:50PM +0200, Mike Rapoport wrote: > From: Mike Rapoport > > The change of ia64's default memory model to SPARSEMEM causes defconfig > build to fail: > > CC kernel/async.o > In file included from in

Re: [PATCH] scsi: target: tcmu: Fix wrong uio handling causing big memory leak

2021-01-13 Thread Mike Christie
On 1/13/21 11:59 AM, Bodo Stroesser wrote: > On 12.01.21 19:36, Mike Christie wrote: >> On 12/18/20 8:15 AM, Bodo Stroesser wrote: >>> tcmu calls uio_unregister_device from tcmu_destroy_device. >>> After that uio will never call tcmu_release for this device. >>

Re: [PATCH v12 12/13] mm/hugetlb: Gather discrete indexes of tail page

2021-01-13 Thread Mike Kravetz
uot; was done before I even noticed your efforts here. At least we agree the metadata could be better organized. :) IMO, using page.private of the head page to consolidate flags will be easier to manage. So, I would like to use that. The BUILD_BUG_ON in this patch makes sense. -- Mike Kravetz

Re: [External] Re: [PATCH v12 04/13] mm/hugetlb: Free the vmemmap pages associated with each HugeTLB page

2021-01-13 Thread Mike Kravetz
ions. - If we see this being used for more general purpose remapping, then we should go with a more general purpose implementation. Again, just my opinion. -- Mike Kravetz

Re: [PATCH v12 03/13] mm: Introduce VM_WARN_ON_PAGE macro

2021-01-13 Thread Mike Kravetz
e/need for this macro in the following patch. Looks like Oscar has already done that, and free_bootmem_page will now use VM_BUG_ON_PAGE. So, this patch can be dropped. -- Mike Kravetz

Re: [RFC PATCH 1/3] hugetlb: use page.private for hugetlb specific page flags

2021-01-13 Thread Mike Kravetz
On 1/13/21 6:45 AM, Matthew Wilcox wrote: > On Mon, Jan 11, 2021 at 01:01:50PM -0800, Mike Kravetz wrote: >> +if (hpage_spool(page)) { > > Could this be named hpage_subpool(), please? > Of course! -- Mike Kravetz

Re: [RFC PATCH 1/3] hugetlb: use page.private for hugetlb specific page flags

2021-01-13 Thread Mike Kravetz
On 1/13/21 5:54 AM, Oscar Salvador wrote: > On Mon, Jan 11, 2021 at 01:01:50PM -0800, Mike Kravetz wrote: >> As hugetlbfs evolved, state information about hugetlb pages was added. >> One 'convenient' way of doing this was to use available fields in tail >> pages. Ove

Re: [PATCH v3 1/2] x86/setup: don't remove E820_TYPE_RAM for pfn 0

2021-01-13 Thread Mike Rapoport
On Wed, Jan 13, 2021 at 01:56:45PM +0100, David Hildenbrand wrote: > On 11.01.21 20:40, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The first 4Kb of memory is a BIOS owned area and to avoid its allocation > > for the kernel it was not listed in e820 tabl

[PATCH] perf: cs-etm: update ETM metadata format

2021-01-13 Thread Mike Leach
, For version 1, the reader will read the number of parameters in the per CPU block. This allows the reader to process older or newer files that may have different numbers of parameters than in use at the time perf was built. Signed-off-by: Mike Leach --- tools/perf/arch/arm/util/cs-etm.c | 3

Re: [PATCH v3 1/2] x86/setup: don't remove E820_TYPE_RAM for pfn 0

2021-01-13 Thread Mike Rapoport
On Wed, Jan 13, 2021 at 09:56:49AM +0100, Oscar Salvador wrote: > On Mon, Jan 11, 2021 at 09:40:16PM +0200, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The first 4Kb of memory is a BIOS owned area and to avoid its allocation > > for the kernel it was not list

Re: [PATCH v1 1/7] coresight: etm-perf: Add support for PID tracing for kernel at EL2

2021-01-12 Thread Mike Leach
Hi Leo, On Tue, 12 Jan 2021 at 14:15, Leo Yan wrote: > > Hi Mike, > > On Tue, Jan 12, 2021 at 11:23:03AM +, Mike Leach wrote: > > Hi Leo, > > > > On Tue, 12 Jan 2021 at 08:58, Leo Yan wrote: > > > > > > Hi Mike, > > > > &g

Re: [PATCH v1 3/7] perf cs-etm: Calculate per CPU metadata array size

2021-01-12 Thread Mike Leach
Hi Leo, On Mon, 11 Jan 2021 at 15:06, Leo Yan wrote: > > Hi Mike, > > On Mon, Jan 11, 2021 at 12:09:12PM +, Mike Leach wrote: > > Hi Leo, > > > > I think there is an issue here in that your modification assumes that > > all cpus in the system are of the

Re: [PATCH v3 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-12 Thread Mike Kravetz
of that code. Free huge pages have a ref count of 0, and this code is checking for ref count of 1. That is a long way of saying that I still agree with this patch. The only modification/suggestion would be enhancing the commit message as suggested by Michal. -- Mike Kravetz

Re: [PATCH] scsi: target: tcmu: Fix wrong uio handling causing big memory leak

2021-01-12 Thread Mike Christie
On 12/18/20 8:15 AM, Bodo Stroesser wrote: > tcmu calls uio_unregister_device from tcmu_destroy_device. > After that uio will never call tcmu_release for this device. > If userspace still had the uio device open and / or mmap'ed > during uio_unregister_device, tcmu_release will not be called and >

Re: kernelci/staging-next bisection: sleep.login on rk3288-rock2-square #2286-staging

2021-01-12 Thread Mike Rapoport
On Tue, Jan 12, 2021 at 10:53:45AM +, Guillaume Tucker wrote: > On 05/01/2021 09:13, Mike Rapoport wrote: > > On Sun, Jan 03, 2021 at 03:09:14PM -0500, Andrea Arcangeli wrote: > >> Hello Mike, > >> > >> On Sun, Jan 03, 2021 at 03:47:53PM +0200, Mike Rapop

Re: [PATCH v1 1/7] coresight: etm-perf: Add support for PID tracing for kernel at EL2

2021-01-12 Thread Mike Leach
Hi Leo, On Tue, 12 Jan 2021 at 08:58, Leo Yan wrote: > > Hi Mike, > > On Mon, Jan 11, 2021 at 04:22:39PM +, Mike Leach wrote: > > [...] > > > > diff --git a/include/linux/coresight-pmu.h b/include/linux/coresight-pmu.h > > > index b0e35eec6499..927c62

Re: [PATCH v3 0/2] mm: fix initialization of struct page for holes in memory layout

2021-01-11 Thread Mike Rapoport
On Mon, Jan 11, 2021 at 04:58:01PM -0800, Andrew Morton wrote: > On Mon, 11 Jan 2021 21:40:15 +0200 Mike Rapoport wrote: > > > Commit 73a6e474cb37 ("mm: memmap_init: iterate over > > memblock regions rather that check each PFN") exposed several issues with >

Re: [PATCH v3 4/6] mm: hugetlb: add return -EAGAIN for dissolve_free_huge_page

2021-01-11 Thread Mike Kravetz
f fail. However, we are very unlikely to ever exercise this code. Adding an optimization that is unlikely to be exercised is certainly questionable. Memory offline is the only code that could benefit from this optimization. As someone with more memory offline user experience, what is your opinion Mic

Re: [PATCH v3 3/6] mm: hugetlb: fix a race between freeing and dissolving the page

2021-01-11 Thread Mike Kravetz
nel.org > --- > mm/hugetlb.c | 26 ++ > 1 file changed, 26 insertions(+) Thanks, It is unfortunate that we have to add more huge page state information to fix this issue. However, I believe we have explored all other options. Reviewed-by: Mike Kravetz -- Mike Kravetz

Re: [RFC PATCH 0/2] userfaultfd: handle minor faults, add UFFDIO_CONTINUE

2021-01-11 Thread Mike Kravetz
associated with those regions are shared by all the mappings. Suitably aligned means 'on a 1GB boundary' and 1GB in size. When pmds are shared, your mappings will never see a 'minor fault'. This is because the PMD (page table entries) is shared. -- Mike Kravetz

Re: [PATCH v3 2/6] mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page

2021-01-11 Thread Mike Kravetz
; --- > fs/hugetlbfs/inode.c| 3 ++- > include/linux/hugetlb.h | 2 ++ > mm/hugetlb.c| 2 +- > 3 files changed, 5 insertions(+), 2 deletions(-) Thanks. Although page_huge_active is declared in page-flags.h, I much prefer the declaration of set_page_huge_active to be in

Re: [RFC PATCH 0/2] userfaultfd: handle minor faults, add UFFDIO_CONTINUE

2021-01-11 Thread Mike Kravetz
On 1/11/21 3:08 PM, Peter Xu wrote: > On Mon, Jan 11, 2021 at 02:42:48PM -0800, Mike Kravetz wrote: >> On 1/7/21 11:04 AM, Axel Rasmussen wrote: >>> Overview >>> >>> >>> This series adds a new userfaultfd registration mode, >>

[RFC PATCH 1/3] hugetlb: use page.private for hugetlb specific page flags

2021-01-11 Thread Mike Kravetz
patches. Signed-off-by: Mike Kravetz --- fs/hugetlbfs/inode.c| 11 +++--- include/linux/hugetlb.h | 2 ++ mm/hugetlb.c| 80 +++-- 3 files changed, 67 insertions(+), 26 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index

[RFC PATCH 3/3] hugetlb: convert PageHugeTemporary() to HPageTempSurplus

2021-01-11 Thread Mike Kravetz
Use new hugetlb specific flag HPageTempSurplus to replace the PageHugeTemporary() interfaces. Signed-off-by: Mike Kravetz --- mm/hugetlb.c | 38 +- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 34ce82f4823c

[RFC PATCH 2/3] hugetlb: convert page_huge_active() to HPageMigratable flag

2021-01-11 Thread Mike Kravetz
, it can not be static. Therefore, a new set of hugetlb page flag macros is added for non-static flag functions. Signed-off-by: Mike Kravetz --- include/linux/hugetlb.h| 17 +++ include/linux/page-flags.h | 6 mm/hugetlb.c | 60

[RFC PATCH 0/3] create hugetlb flags to consolidate state

2021-01-11 Thread Mike Kravetz
feature is enabled. [1] https://lore.kernel.org/r/20210106084739.63318-1-songmuc...@bytedance.com [2] https://lore.kernel.org/r/20210110124017.86750-4-songmuc...@bytedance.com Mike Kravetz (3): hugetlb: use page.private for hugetlb specific page flags hugetlb: convert page_huge_active

[PATCH v3 2/2] mm: fix initialization of struct page for holes in memory layout

2021-01-11 Thread Mike Rapoport
From: Mike Rapoport There could be struct pages that are not backed by actual physical memory. This can happen when the actual memory bank is not a multiple of SECTION_SIZE or when an architecture does not register memory holes reserved by the firmware as memblock.memory. Such pages

[PATCH v3 1/2] x86/setup: don't remove E820_TYPE_RAM for pfn 0

2021-01-11 Thread Mike Rapoport
From: Mike Rapoport The first 4Kb of memory is a BIOS owned area and to avoid its allocation for the kernel it was not listed in e820 tables as memory. As the result, pfn 0 was never recognised by the generic memory management and it is not a part of neither node 0 nor ZONE_DMA

[PATCH v3 0/2] mm: fix initialization of struct page for holes in memory layout

2021-01-11 Thread Mike Rapoport
From: Mike Rapoport Hi, Commit 73a6e474cb37 ("mm: memmap_init: iterate over memblock regions rather that check each PFN") exposed several issues with the memory map initialization and these patches fix those issues. Initially there were crashes during compaction that Qian Cai rep

Re: [PATCH v2 2/2] mm: fix initialization of struct page for holes in memory layout

2021-01-11 Thread Mike Rapoport
On Mon, Jan 11, 2021 at 10:06:43AM -0500, Qian Cai wrote: > On Sun, 2021-01-10 at 17:39 +0200, Mike Rapoport wrote: > > On Wed, Jan 06, 2021 at 04:04:21PM -0500, Qian Cai wrote: > > > On Wed, 2021-01-06 at 10:05 +0200, Mike Rapoport wrote: > > > > I think we trigger P

Re: [PATCH v1 1/7] coresight: etm-perf: Add support for PID tracing for kernel at EL2

2021-01-11 Thread Mike Leach
). So that the user doesn't have to bother which EL the > kernel is running. > > i.e, perf record -e cs_etm/pid/u -- > > will always do the "pid" tracing, independent of the kernel EL. > > Also, the perf tool will be updated to automatically select > "pid"

Re: [RFC 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-01-11 Thread Mike Rapoport
> Apart from the above example in valid_phys_addr_range(), there are some > > other memblock_is_map_memory() call sites as well. But then, we are not > > trying to completely drop memblock_is_map_memory() or are we ? > > No, just change the semantics: only relevant for early sections. Imagine > freezing MEMBLOCK state after boot. > > Only early sections can have memory holes and might be marked > MEMBLOCK_NOMAP. For hotplugged memory, we don't have to call > memblock_is_map_memory(). > > -- > Thanks, > > David / dhildenb -- Sincerely yours, Mike.

Re: [PATCH v1 3/7] perf cs-etm: Calculate per CPU metadata array size

2021-01-11 Thread Mike Leach
of the format to be more self describing - which should probably be opened out to the CS mailing list. Regards Mike On Mon, 11 Jan 2021 at 07:29, Suzuki K Poulose wrote: > > On 1/9/21 7:44 AM, Leo Yan wrote: > > The metadata array can be extended over time and the to

RE: [PATCH v8 03/20] dlb: add resource and device initialization

2021-01-10 Thread Chen, Mike Ximing
> -Original Message- > From: Greg KH > Sent: Thursday, January 7, 2021 2:40 PM > To: Chen, Mike Ximing > Cc: linux-kernel@vger.kernel.org; a...@arndb.de; Williams, Dan J > ; pierre-louis.boss...@linux.intel.com; Gage Eads > > Subject: Re: [PATCH v8 03/20] dlb:

Re: [PATCH v2 2/2] mm: fix initialization of struct page for holes in memory layout

2021-01-10 Thread Mike Rapoport
On Wed, Jan 06, 2021 at 04:04:21PM -0500, Qian Cai wrote: > On Wed, 2021-01-06 at 10:05 +0200, Mike Rapoport wrote: > > I think we trigger PF_POISONED_CHECK() in PageSlab(), then fffe > > is "accessed" from VM_BUG_ON_PAGE(). > > > > It seems to m

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-09 Thread Chen, Mike Ximing
> -Original Message- > From: Greg KH > Sent: Saturday, January 9, 2021 3:34 AM > To: Chen, Mike Ximing > Cc: linux-kernel@vger.kernel.org; a...@arndb.de; Williams, Dan J > ; pierre-louis.boss...@linux.intel.com > Subject: Re: [PATCH v8 04/20] dlb: add device

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-08 Thread Chen, Mike Ximing
> -Original Message- > From: Greg KH > Sent: Thursday, January 7, 2021 2:42 PM > To: Chen, Mike Ximing > Cc: linux-kernel@vger.kernel.org; a...@arndb.de; Williams, Dan J > ; pierre-louis.boss...@linux.intel.com; Gage Eads > > Subject: Re: [PATCH v8 04/20] dlb

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-08 Thread Chen, Mike Ximing
> -Original Message- > From: Greg KH > Sent: Thursday, January 7, 2021 2:51 PM > To: Chen, Mike Ximing > Cc: linux-kernel@vger.kernel.org; a...@arndb.de; Williams, Dan J > ; pierre-louis.boss...@linux.intel.com; Gage Eads > > Subject: Re: [PATCH v8 04/20] dlb

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-08 Thread Chen, Mike Ximing
> -Original Message- > From: Greg KH > Sent: Thursday, January 7, 2021 2:41 PM > To: Chen, Mike Ximing > Cc: linux-kernel@vger.kernel.org; a...@arndb.de; Williams, Dan J > ; pierre-louis.boss...@linux.intel.com; Gage Eads > > Subject: Re: [PATCH v8 04/20] dlb

RE: [PATCH v8 01/20] dlb: add skeleton for DLB driver

2021-01-08 Thread Chen, Mike Ximing
> -Original Message- > From: Greg KH > Sent: Thursday, January 7, 2021 2:36 PM > To: Chen, Mike Ximing > Cc: linux-kernel@vger.kernel.org; a...@arndb.de; Williams, Dan J > ; pierre-louis.boss...@linux.intel.com; Gage Eads > > Subject: Re: [PATCH v8 01/20] d

Re: [PATCH v2 6/6] mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active

2021-01-08 Thread Mike Kravetz
ger a BUG_ON which is in the > page_huge_active() when CONFIG_DEBUG_VM is enabled. Just remove the > VM_BUG_ON_PAGE. > > Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()") > Signed-off-by: Muchun Song > Reviewed-by: Mike Kravetz > --- > mm

Re: [PATCH] perf tools: Update OpenCSD to v1.0.0

2021-01-08 Thread Mike Leach
Hi James, I have tested this with OpenCSD v1.0.0 + Linux 5.11-rc2. Reviewed-by: Mike Leach Tested-by: Mike Leach On Fri, 8 Jan 2021 at 14:28, James Clark wrote: > > Replace the OCSD_INSTR switch statement with an if to > fix compilation error about unhandled values and avoid >

Re: [External] Re: [PATCH v2 3/6] mm: hugetlb: fix a race between freeing and dissolving the page

2021-01-07 Thread Mike Kravetz
touch > the page->mapping. So we need to check PageHuge(). > The check and llist_add() should be protected by > hugetlb_lock. But we cannot do that. Right? If dissolve > happens after it is linked to the list. We also should > remove it from the list (hpage_freelist). It seems to make > the thing more complex. You are correct. This is also an issue/potential problem with this race. It seems that adding the state information might be the least complex way to address issue. -- Mike Kravetz

Re: [PATCH v2 3/6] mm: hugetlb: fix a race between freeing and dissolving the page

2021-01-07 Thread Mike Kravetz
On 1/7/21 12:40 AM, Michal Hocko wrote: > On Wed 06-01-21 12:58:29, Mike Kravetz wrote: >> On 1/6/21 8:56 AM, Michal Hocko wrote: >>> On Wed 06-01-21 16:47:36, Muchun Song wrote: >>>> There is a race condition between __free_huge_page() >>>> and

Re: [PATCH 3/6] hugetlb: add free page reporting support

2021-01-07 Thread Mike Kravetz
to_nid(page); > + > + list_move(>lru, >hugepage_freelists[nid]); > +} The above routines move pages between the free and active lists without any update to free page counts. How does that work? Will the number of entries on the free list get out of sync with the free_huge_pages counters? -- Mike Kravetz

Re: [PATCH] mm/hugetlb: Fix potential double free in hugetlb_register_node() error path

2021-01-07 Thread Mike Kravetz
. > > Fixes: a3437870160c ("hugetlb: new sysfs interface") > Signed-off-by: Miaohe Lin > Cc: > --- > mm/hugetlb.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Thanks, this is a potential issue that should be fixed. Reviewed-by: Mike Kravetz This

<    6   7   8   9   10   11   12   13   14   15   >