Re: [PATCH] /proc/kpagecount: return 0 for special pages that are never mapped

2018-12-07 Thread Andrew Morton
On Wed, 5 Dec 2018 22:07:37 -0800 Anthony Yznaga wrote: > Would you like me to submit a revised patch?  An -mm tree diff? Either is OK. I usually turn replacemensts into deltas so we can see what changed.

Re: [PATCH] checkstack.pl: fix for aarch64

2018-12-07 Thread Andrew Morton
On Fri, 7 Dec 2018 14:58:43 -0500 Qian Cai wrote: > There is actually a space after "sp," like this, > > 280813c8: a9bb7bfdstp x29, x30, [sp, #-80]! > Confused. Why does this matter? Why is the patched version superior?

Re: [PATCH 2/2] mm/sparse: add common helper to mark all memblocks present

2018-12-07 Thread Andrew Morton
On Thu, 6 Dec 2018 10:40:31 -0700 Logan Gunthorpe wrote: > Hey Andrew, > > On 2018-11-07 1:12 p.m., Andrew Morton wrote: > > Acked-by: Andrew Morton > > > > I can grab both patches and shall sneak them into 4.20-rcX, but feel > > free to merge them into som

Re: [GIT PULL] Uprobes: Fix kernel oops with delayed_uprobe_remove()

2018-12-06 Thread Andrew Morton
On Thu, 6 Dec 2018 12:47:19 -0500 Steven Rostedt wrote: > > Uprobes: Fix kernel oops with delayed_uprobe_remove() > > There could be a race between task exit and probe unregister: > > exit_mm() > mmput() > __mmput() uprobe_unregister() >

Re: [PATCH 4/4] mm: use the cached page for filemap_fault

2018-12-04 Thread Andrew Morton
On Fri, 30 Nov 2018 14:58:12 -0500 Josef Bacik wrote: > If we drop the mmap_sem we have to redo the vma lookup which requires > redoing the fault handler. Chances are we will just come back to the > same page, so save this page in our vmf->cached_page and reuse it in the > next loop through the

Re: [PATCH 3/4] filemap: drop the mmap_sem for all blocking operations

2018-12-04 Thread Andrew Morton
On Fri, 30 Nov 2018 14:58:11 -0500 Josef Bacik wrote: > Currently we only drop the mmap_sem if there is contention on the page > lock. The idea is that we issue readahead and then go to lock the page > while it is under IO and we want to not hold the mmap_sem during the IO. > > The problem

Re: [PATCH 1/4] mm: infrastructure for page fault page caching

2018-12-04 Thread Andrew Morton
On Fri, 30 Nov 2018 14:58:09 -0500 Josef Bacik wrote: > We want to be able to cache the result of a previous loop of a page > fault in the case that we use VM_FAULT_RETRY, Please explain here why we want to do that. > so introduce > handle_mm_fault_cacheable that will take a struct vm_fault

Re: [PATCH 0/4][V4] drop the mmap_sem when doing IO in the fault path

2018-12-04 Thread Andrew Morton
On Fri, 30 Nov 2018 14:58:08 -0500 Josef Bacik wrote: > Now that we have proper isolation in place with cgroups2 we have started going > through and fixing the various priority inversions. Most are all gone now, > but > this one is sort of weird since it's not necessarily a priority inversion

Re: [PATCH v5 1/2] kernel/signal: Signal-based pre-coredump notification

2018-12-04 Thread Andrew Morton
On Wed, 28 Nov 2018 16:15:35 -0800 Enke Chen wrote: > Thanks for your comments. You have indeed missed some of the prior reviews > and discussions. But that is OK. This is why it is best to update the changelog in response to the review discussion - if person A was wondering about something

Re: [PATCH 7/7] lib/lzo: separate lzo-rle from lzo

2018-11-29 Thread Andrew Morton
On Thu, 29 Nov 2018 10:21:53 + Dave Rodgman wrote: > >> @@ -41,7 +41,7 @@ static DEFINE_IDR(zram_index_idr); > >> static DEFINE_MUTEX(zram_index_mutex); > >> > >> static int zram_major; > >> -static const char *default_compressor = "lzo"; > >> +static const char *default_compressor =

Re: [PATCH] Security: Handle hidepid option correctly

2018-11-29 Thread Andrew Morton
> [PATCH] Security: Handle hidepid option correctly Why is this considered to be security sensitive? I can guess, but I'd like to know your reasoning. On Thu, 29 Nov 2018 19:08:21 +0800 d17103...@gmail.com wrote: > From: Cheng Yang > > The proc_parse_options() call from proc_mount() runs

Re: [PATCH 1/3] add generic builtin command line

2018-11-28 Thread Andrew Morton
On Fri, 9 Nov 2018 09:34:31 -0800 Daniel Walker wrote: > This code allows architectures to use a generic builtin command line. > The state of the builtin command line options across architecture is > diverse. On x86 and mips they have pretty much the same code and the > code prepends the

Re: [PATCH v3 7/7] zram: writeback throttle

2018-11-28 Thread Andrew Morton
On Tue, 27 Nov 2018 14:54:29 +0900 Minchan Kim wrote: > On small memory system, there are lots of write IO so if we use > flash device as swap, there would be serious flash wearout. > To overcome the problem, system developers need to design write > limitation strategy to guarantee flash health

Re: [PATCH v3 5/7] zram: support idle/huge page writeback

2018-11-28 Thread Andrew Morton
On Tue, 27 Nov 2018 14:54:27 +0900 Minchan Kim wrote: > This patch supports new feature "zram idle/huge page writeback". > On zram-swap usecase, zram has usually many idle/huge swap pages. > It's pointless to keep in memory(ie, zram). > > To solve the problem, this feature introduces idle/huge

Re: [PATCH v2 6/7] zram: add bd_stat statistics

2018-11-28 Thread Andrew Morton
On Tue, 27 Nov 2018 11:07:54 +0900 Minchan Kim wrote: > On Mon, Nov 26, 2018 at 12:58:33PM -0800, Andrew Morton wrote: > > On Mon, 26 Nov 2018 17:28:12 +0900 Minchan Kim wrote: > > > > > +File /sys/block/zram/bd_stat > > > + > > > +The stat file rep

Re: [PATCH 2/7] lib/lzo: clean-up by introducing COPY16

2018-11-27 Thread Andrew Morton
On Tue, 27 Nov 2018 16:19:31 + Dave Rodgman wrote: > From: Matt Sealey > > ... > > Signed-off-by: Matt Sealey Several of the From:Matt patches were missing your Signed-off-by:. I added it. [patch 5/7] had the signoffs in an inappropriate order - I switched them.

Re: [PATCH v2] panic: Avoid the extra noise dmesg

2018-11-26 Thread Andrew Morton
On Thu, 8 Nov 2018 21:05:03 +0800 Feng Tang wrote: > Sometimes when debugging kernel panic, we saw many extra noisy error > messages after the expected end: > > [ 35.743249] ---[ end Kernel panic - not syncing: Fatal exception > [ 35.749975] [ cut here ] What are

Re: [PATCH] initramfs: clean old path before creating a hardlink

2018-11-26 Thread Andrew Morton
On Fri, 16 Nov 2018 15:12:48 +0800 Li Zhijian wrote: > Previously, sys_link() will fail due to the new path is already existed. > this case ofen appears when we use a concated initrd, below is an > sample: > > 1) prepare a basic rootfs, it contains a regular files rc.local >

Re: [RFC PATCH] panic: Add options to dump system info when panic happens

2018-11-26 Thread Andrew Morton
On Thu, 22 Nov 2018 15:10:31 +0800 Feng Tang wrote: > Kernel panic issues are always painful to debug, partially > because of it's not easy to get enough information of the > context when panic happens. > > And we have ramoops and kdump for that, while this commit > tries to a easier way to

Re: [PATCH v2 6/7] zram: add bd_stat statistics

2018-11-26 Thread Andrew Morton
On Mon, 26 Nov 2018 17:28:12 +0900 Minchan Kim wrote: > +File /sys/block/zram/bd_stat > + > +The stat file represents device's backing device statistics. It consists of > +a single line of text and contains the following stats separated by > whitespace: > + bd_countsize of data written in

Re: [PATCH v2 7/7] zram: writeback throttle

2018-11-26 Thread Andrew Morton
On Mon, 26 Nov 2018 17:28:13 +0900 Minchan Kim wrote: > On small memory system, there are lots of write IO so if we use > flash device as swap, there would be serious flash wearout. > To overcome the problem, system developers need to design write > limitation strategy to guarantee flash health

Re: [PATCH v2 1/7] zram: fix lockdep warning of free block handling

2018-11-26 Thread Andrew Morton
On Mon, 26 Nov 2018 17:28:07 +0900 Minchan Kim wrote: > > ... > > With writeback feature, zram_slot_free_notify could be called > in softirq context by end_swap_bio_read. However, bitmap_lock > is not aware of that so lockdep yell out. Thanks. > > The problem is not only bitmap_lock but it is

Re: [PATCH -next 1/2] mm/memfd: make F_SEAL_FUTURE_WRITE seal more robust

2018-11-24 Thread Andrew Morton
On Thu, 22 Nov 2018 15:09:06 -0800 Joel Fernandes wrote: > Android uses ashmem for sharing memory regions. We are looking forward to > migrating all usecases of ashmem to memfd so that we can possibly remove > the ashmem driver in the future from staging while also benefiting from > using

Re: [RFC PATCH 1/5] mm: print more information about mapping in __dump_page

2018-11-23 Thread Andrew Morton
On Wed, 7 Nov 2018 11:18:26 +0100 Michal Hocko wrote: > From: Michal Hocko > > __dump_page prints the mapping pointer but that is quite unhelpful > for many reports because the pointer itself only helps to distinguish > anon/ksm mappings from other ones (because of lowest bits > set).

Re: [PATCH v2 1/5] autofs - improve ioctl sbi checks

2018-11-23 Thread Andrew Morton
On Fri, 23 Nov 2018 18:41:50 +0800 Ian Kent wrote: > Al Viro made some suggestions to improve the implementation > of commit 0633da48f0 "fix autofs_sbi() does not check super > block type". > > The check is unnessesary in all cases except for ioctl usage > so placing the check in the super

Re: [PATCH] locking/atomics: build atomic headers as required

2018-11-23 Thread Andrew Morton
On Fri, 23 Nov 2018 15:33:21 + Mark Rutland wrote: > Andrew and Ingo report that the check-atomics.sh script is simply too > slow to run for every kernel build, and it's impractical to make it > faster without rewriting it in something other than shell. > > Rather than committing the

Re: [PATCH] ipc/shm.c: removed 'int err' from shm_get_policy()

2018-11-21 Thread Andrew Morton
On Sun, 18 Nov 2018 23:49:11 + danielijrob...@gmail.com wrote: > removed unneeded variable in shm_get_policy() > > ... > > --- a/ipc/shm.c > +++ b/ipc/shm.c > @@ -461,11 +461,10 @@ static int shm_set_policy(struct vm_area_struct *vma, > struct mempolicy *new) > { > struct file *file

Re: [PATCH v3] mm: use swp_offset as key in shmem_replace_page()

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 14:54:42 -0700 Yu Zhao wrote: > We changed key of swap cache tree from swp_entry_t.val to > swp_offset. Need to do so in shmem_replace_page() as well. What are the user-visible effects of this change? > Fixes: f6ab1f7f6b2d ("mm, swap: use offset of swap entry as key of swap

Re: [PATCH] procfs: fix the output format in /proc/PID/wchan

2018-11-21 Thread Andrew Morton
On Mon, 19 Nov 2018 19:17:52 +0800 Yafang Shao wrote: > Just add the missing newline. > > ... > > --- a/fs/proc/base.c > +++ b/fs/proc/base.c > @@ -370,11 +370,12 @@ static int proc_pid_wchan(struct seq_file *m, struct > pid_namespace *ns, > wchan = get_wchan(task); > if (wchan &&

Re: [PATCH v4 1/3] kernel.h: disable type-checks in container_of() for Sparse

2018-11-21 Thread Andrew Morton
On Thu, 22 Nov 2018 12:14:20 +0900 Masahiro Yamada wrote: > When I tried to enable BUILD_BUG_ON for Sparse, the kbuild test robot > reported lots of "unknown expression" warnings from container_of(), > which seemed false positive. > > I addressed this in [1], but fixing Sparse is the right

Re: [PATCH -next 1/2] mm/memfd: make F_SEAL_FUTURE_WRITE seal more robust

2018-11-21 Thread Andrew Morton
8041537.39694-1-j...@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Cc: John Stultz Cc: John Reck Cc: Todd Kjos Cc: Greg Kroah-Hartman Cc: Christoph Hellwig Cc: Al Viro Cc: Daniel Colascione Cc: J. Bruce Fields Cc: Jeff Layton Cc: Khalid Aziz Cc: Lei Yang Cc: Marc-Andr Lureau C

Re: [PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2018-11-21 Thread Andrew Morton
On Mon, 19 Nov 2018 22:06:16 -0800 Andrei Vagin wrote: > There are a few system calls (pselect, ppoll, etc) which replace a task > sigmask while they are running in a kernel-space > > When a task calls one of these syscalls, the kernel saves a current > sigmask in task->saved_sigmask and sets a

Re: [PATCH v5] kernel/signal: Signal-based pre-coredump notification

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 17:09:50 -0800 Enke Chen wrote: > Hi, Andrew: > > On 11/21/18 4:37 PM, Andrew Morton wrote: > > On Tue, 30 Oct 2018 17:46:29 +0100 Oleg Nesterov wrote: > > > >> On 10/29, Enke Chen wrote: > >>> > >>> R

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 17:08:08 -0800 Daniel Colascione wrote: > Have you done much > retrospective long trace analysis? No. Have you? Of course you have, which is why I and others are dependent upon you to explain why this change is worth adding to Linux. If this thing solves a problem which

Re: [PATCH v5] kernel/signal: Signal-based pre-coredump notification

2018-11-21 Thread Andrew Morton
On Tue, 30 Oct 2018 17:46:29 +0100 Oleg Nesterov wrote: > On 10/29, Enke Chen wrote: > > > > Reviewed-by: Oleg Nesterov > > Hmm. I didn't say this ;) > > But OK, feel free to keep this tag. > > I do not like this feauture. Why is that? > But I see no technical problems in this version >

Re: [PATCH] mm/gup: finish consolidating error handling

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 00:14:02 -0800 john.hubb...@gmail.com wrote: > Commit df06b37ffe5a4 ("mm/gup: cache dev_pagemap while pinning pages") > attempted to operate on each page that get_user_pages had retrieved. In > order to do that, it created a common exit point from the routine. > However, one

Re: [PATCHv3 1/6] atomics: add common header generation files

2018-11-21 Thread Andrew Morton
On Fri, 16 Nov 2018 02:51:21 + Mark Rutland wrote: > Hi Andrew, > > On Thu, Nov 15, 2018 at 03:10:48PM -0800, Andrew Morton wrote: > > On Tue, 4 Sep 2018 11:48:25 +0100 Mark Rutland > > wrote: > > > > > To minimize repetition, to allow for future re

Re: [PATCH v2] Add /proc/pid_gen

2018-11-21 Thread Andrew Morton
On Wed, 21 Nov 2018 12:54:20 -0800 Daniel Colascione wrote: > Trace analysis code needs a coherent picture of the set of processes > and threads running on a system. While it's possible to enumerate all > tasks via /proc, this enumeration is not atomic. If PID numbering > rolls over during

Re: [RFC PATCH 5/5] mm, memory_hotplug: be more verbose for memory offline failures

2018-11-15 Thread Andrew Morton
On Wed, 7 Nov 2018 11:18:30 +0100 Michal Hocko wrote: > From: Michal Hocko > > There is only very limited information printed when the memory offlining > fails: > [ 1984.506184] rac1 kernel: memory offlining [mem > 0x826-0x8267fff] failed due to signal backoff > > This tells us

Re: [PATCHv3 1/6] atomics: add common header generation files

2018-11-15 Thread Andrew Morton
On Tue, 4 Sep 2018 11:48:25 +0100 Mark Rutland wrote: > To minimize repetition, to allow for future rework, and to ensure > regularity of the various atomic APIs, we'd like to automatically > generate (the bulk of) a number of headers related to atomics. > > This patch adds the infrastructure

Re: [PATCHv3 1/6] atomics: add common header generation files

2018-11-15 Thread Andrew Morton
/atomic/gen-atomic-long.sh: Permission denied scripts/atomic/check-atomics.sh: line 16: scripts/atomic/gen-atomic-fallback.sh: Permission denied From: Andrew Morton Subject: scripts/atomic/check-atomics.sh: don't assume that scripts are executable patch(1) doesn't set the x bit on files. So if

Re: [PATCH AUTOSEL 3.18 8/9] mm/vmstat.c: assert that vmstat_text is in sync with stat_items_size

2018-11-15 Thread Andrew Morton
On Thu, 15 Nov 2018 17:37:18 -0500 Sasha Levin wrote: > On Thu, Nov 15, 2018 at 02:08:10PM -0800, Andrew Morton wrote: > >On Tue, 13 Nov 2018 00:52:51 -0500 Sasha Levin wrote: > > > >> From: Jann Horn > >> > >> [ Upstream commit f0ecf25a093fc0589f0a6

Re: [PATCH V4] binder: ipc namespace support for android binder

2018-11-15 Thread Andrew Morton
s mainly an android patch so I suggest this be taken via the android tree. Acked-by: Andrew Morton

Re: [PATCH] mm: cleancache: fix corruption on missed inode invalidation

2018-11-15 Thread Andrew Morton
On Mon, 12 Nov 2018 12:57:34 +0300 Pavel Tikhomirov wrote: > If all pages are deleted from the mapping by memory reclaim and also > moved to the cleancache: > > __delete_from_page_cache > (no shadow case) > unaccount_page_cache_page > cleancache_put_page > page_cache_delete >

Re: [PATCH] mm: cleancache: fix corruption on missed inode invalidation

2018-11-15 Thread Andrew Morton
On Mon, 12 Nov 2018 12:31:53 +0100 Jan Kara wrote: > > mm/truncate.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > The patch looks good but can you add a short comment before the > truncate_inode_pages() call explaining why it needs to be called always? > Something like: >

Re: [PATCH AUTOSEL 3.18 8/9] mm/vmstat.c: assert that vmstat_text is in sync with stat_items_size

2018-11-15 Thread Andrew Morton
On Tue, 13 Nov 2018 00:52:51 -0500 Sasha Levin wrote: > From: Jann Horn > > [ Upstream commit f0ecf25a093fc0589f0a6bc4c1ea068bbb67d220 ] > > Having two gigantic arrays that must manually be kept in sync, including > ifdefs, isn't exactly robust. To make it easier to catch such issues in >

Re: [PATCH] mm: use managed_zone() for more exact check in zone iteration

2018-11-15 Thread Andrew Morton
On Thu, 15 Nov 2018 07:50:40 +0800 Wei Yang wrote: > For one zone, there are three digits to describe its space range: > > spanned_pages > present_pages > managed_pages > > The detailed meaning is written in include/linux/mmzone.h. This patch > concerns about the last two. > >

Re: [RFC PATCH 1/1] vmalloc: add test driver to analyse vmalloc allocator

2018-11-15 Thread Andrew Morton
On Thu, 15 Nov 2018 05:47:06 -0800 Matthew Wilcox wrote: > On Thu, Nov 15, 2018 at 01:57:50PM +0100, Michal Hocko wrote: > > On Thu 15-11-18 00:46:42, Matthew Wilcox wrote: > > > How about adding > > > > > > #ifdef CONFIG_VMALLOC_TEST > > > int run_internal_vmalloc_tests(void) > > > { > > > ...

Re: [RFC PATCH] mm, memory_hotplug: do not clear numa_node association after hot_remove

2018-11-14 Thread Andrew Morton
On Wed, 14 Nov 2018 08:14:42 +0100 Michal Hocko wrote: > It seems there were no objections here. So can we have it in linux-next > for a wider testing a possibly target the next merge window? > top-posting sucks! I already have this queued for 4.21-rc1.

Re: [RFC PATCH 1/1] vmalloc: add test driver to analyse vmalloc allocator

2018-11-14 Thread Andrew Morton
On Wed, 14 Nov 2018 16:17:37 +0100 Michal Hocko wrote: > On Tue 13-11-18 14:10:46, Andrew Morton wrote: > [...] > > > +static int vmalloc_test_init(void) > > > +{ > > > + __my_vmalloc_node_range = > > > + (void *)

Re: [PATCH 2/2] fs/epoll: deal with wait_queue only once

2018-11-14 Thread Andrew Morton
On Wed, 14 Nov 2018 10:25:32 -0800 Davidlohr Bueso wrote: > There is no reason why we rearm the waitiqueue upon every > fetch_events retry (for when events are found yet send_events() > fails). If nothing else, this saves four lock operations per > retry, and furthermore reduces the scope of the

Re: UBSAN: Undefined behaviour in mm/page_alloc.c

2018-11-13 Thread Andrew Morton
On Wed, 14 Nov 2018 00:23:28 +0100 Vlastimil Babka wrote: > On 11/14/18 12:15 AM, Andrew Morton wrote: > > On Tue, 13 Nov 2018 10:43:05 +0100 Michal Hocko wrote: > > > >> --- a/mm/page_alloc.c > >> +++ b/mm/page_alloc.c > >> @@ -4364,6 +4353,1

Re: UBSAN: Undefined behaviour in mm/page_alloc.c

2018-11-13 Thread Andrew Morton
On Tue, 13 Nov 2018 10:43:05 +0100 Michal Hocko wrote: > From: Michal Hocko > Date: Fri, 9 Nov 2018 09:35:29 +0100 > Subject: [PATCH] mm, page_alloc: check for max order in hot path > > Konstantin has noticed that kvmalloc might trigger the following warning > [Thu Nov 1 08:43:56 2018]

Re: UBSAN: Undefined behaviour in mm/page_alloc.c

2018-11-13 Thread Andrew Morton
On Tue, 13 Nov 2018 10:43:05 +0100 Michal Hocko wrote: > Konstantin has noticed that kvmalloc might trigger the following warning > [Thu Nov 1 08:43:56 2018] WARNING: CPU: 0 PID: 6676 at mm/vmstat.c:986 > __fragmentation_index+0x54/0x60 > [...] > [Thu Nov 1 08:43:56 2018] Call Trace: > [Thu

Re: [RFC PATCH 1/1] vmalloc: add test driver to analyse vmalloc allocator

2018-11-13 Thread Andrew Morton
On Tue, 13 Nov 2018 16:16:29 +0100 "Uladzislau Rezki (Sony)" wrote: > This adds a new kernel module for analysis of vmalloc allocator. It is > only enabled as a module. There are two main reasons this module should > be used for. Those are performance evaluation and stressing of vmalloc >

Re: [PATCH 2/2] exec: increase BINPRM_BUF_SIZE to 256

2018-11-13 Thread Andrew Morton
On Tue, 13 Nov 2018 17:55:58 +0100 Oleg Nesterov wrote: > > However it would be basically cost-free to increase > > BINPRM_BUF_SIZE up to the point where sizeof(struct linux_binprm) == > > PAGE_SIZE? > > I don't think we should take sizeof(struct linux_binprm) into account, the > new members

Re: [PATCH 2/2] exec: increase BINPRM_BUF_SIZE to 256

2018-11-12 Thread Andrew Morton
On Mon, 12 Nov 2018 17:09:56 +0100 Oleg Nesterov wrote: > Large enterprise clients often times run applications out of networked > file systems where the IT mandated layout of project volumes can end up > leading to paths that are longer than 128 characters. Bumping this up to > the next order

Re: [PATCH v3] ksm: Assist buddy allocator to assemble 1-order pages

2018-11-09 Thread Andrew Morton
On Fri, 19 Oct 2018 15:33:39 +0300 Kirill Tkhai wrote: > v3: Comment improvements. > v2: Style improvements. > > try_to_merge_two_pages() merges two pages, one of them > is a page of currently scanned mm, the second is a page > with identical hash from unstable tree. Currently, we > merge the

Re: [PATCH v3 resend 1/2] mm: Add an F_SEAL_FUTURE_WRITE seal to memfd

2018-11-09 Thread Andrew Morton
On Wed, 7 Nov 2018 20:15:36 -0800 "Joel Fernandes (Google)" wrote: > Android uses ashmem for sharing memory regions. We are looking forward > to migrating all usecases of ashmem to memfd so that we can possibly > remove the ashmem driver in the future from staging while also > benefiting from

Re: [PATCH] slab.h: Avoid using & for logical and of booleans

2018-11-09 Thread Andrew Morton
s to compile without a branch or cmov by itself. > > The result should be more readable, without a sparse warning and probably also > faster for the common case. > > Reported-by: Bart Van Assche > Reported-by: Darryl T. Agostinelli > Suggested-by: Andrew Morton > Suggeste

Re: [PATCH v2 3/3] slab: use logical instead of bitwise operation in kmalloc_type()

2018-11-09 Thread Andrew Morton
On Fri, 9 Nov 2018 10:35:34 +0100 Johannes Berg wrote: > The operation here really is more logical than bitwise, even if > due to the setup the bitwise operation works fine. However, this > causes a complaint from sparse that the operation doesn't really > make sense due to the not. > > Use a

Re: [PATCH] mm:vmalloc add vm_struct for vm_map_ram

2018-11-08 Thread Andrew Morton
On Thu, 8 Nov 2018 19:14:49 +0800 Zhaoyang Huang wrote: > There is no caller and pages information etc for the area which is > created by vm_map_ram as well as the page count > VMAP_MAX_ALLOC. > Add them on in this commit. Well I can kind of see what this is doing - it increases the amount of

Re: [PATCH] z3fold: fix wrong handling of headless pages

2018-11-08 Thread Andrew Morton
On Thu, 8 Nov 2018 22:45:40 +0900 Jongseok Kim wrote: > Yes, you are right. > I think that's the best way to deal it. > Thank you. I did this: Link: http://lkml.kernel.org/r/20181105162225.74e8837d03583a9b707cf...@gmail.com Signed-off-by: Vitaly Wool Signed-off-by: Jongseok Kim

Re: [Bug 201637] New: hangup sinse 'x86/mm: Expand static page table for fixmap space' with CONFIG_RANDOMIZE_BASE enabled

2018-11-08 Thread Andrew Morton
(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Thu, 08 Nov 2018 13:48:25 + bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=201637 > > Bug ID: 201637 >Summary: hangup

Re: [LKP] d50d82faa0 [ 33.671845] WARNING: possible circular locking dependency detected

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 15:43:36 -0800 Andrew Morton wrote: > On Tue, 23 Oct 2018 08:30:04 +0800 kernel test robot > wrote: > > > Greetings, > > > > 0day kernel testing robot got the below dmesg and the first bad commit is > > > > https://git.kerne

Re: [LKP] d50d82faa0 [ 33.671845] WARNING: possible circular locking dependency detected

2018-11-07 Thread Andrew Morton
> > Link: > http://lkml.kernel.org/r/alpine.lrh.2.02.1806151817130.6...@file01.intranet.prod.int.rdu2.redhat.com > Signed-off-by: Mikulas Patocka > Reported-by: Mike Snitzer > Tested-by: Mike Snitzer > Cc: Christoph Lameter > Cc: Pekka En

Re: [PATCH] scripts/spdxcheck: make python3 compliant

2018-11-07 Thread Andrew Morton
On Tue, 23 Oct 2018 09:08:02 +0200 Uwe Kleine-König wrote: > Without this change the following happens when using Python3 (3.6.6): > > $ echo "GPL-2.0" | python3 scripts/spdxcheck.py - > FAIL: 'str' object has no attribute 'decode' > Traceback (most recent call last): >

Re: [PATCH] z3fold: encode object length in the handle

2018-11-07 Thread Andrew Morton
On Mon, 29 Oct 2018 13:27:36 +0100 Vitaly Wool wrote: > Hi Andrew, > > Den tors 25 okt. 2018 kl 21:42 skrev Andrew Morton < > a...@linux-foundation.org>: > > > On Thu, 25 Oct 2018 11:28:21 +0200 Vitaly Wool > > wrote: > > > > > Reclaim and f

Re: [PATCH V2] binder: ipc namespace support for android binder

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 01:48:12 + chouryzhou(周威) wrote: > > > --- a/ipc/namespace.c > > > +++ b/ipc/namespace.c > > > @@ -56,6 +56,9 @@ static struct ipc_namespace *create_ipc_ns(struct > > user_namespace *user_ns, > > > ns->ucounts = ucounts; > > > > > > err = mq_init_ns(ns); >

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 08:21:07 +0200 Alexey Skidanov wrote: > > Why does this need "fixing"? Are there current callers which can > > misalign chunk_start_addr? Or is there a requirement that future > > callers can misalign chunk_start_addr? > > > I work on adding aligned allocation support for

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 08:27:31 +0200 Alexey Skidanov wrote: > > > On 11/7/18 12:15 AM, Andrew Morton wrote: > > On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov > > wrote: > > > >> On success, gen_pool_first_fit_align() returns the bit number such that &

Re: [RFC PATCH 4/5] mm, memory_hotplug: print reason for the offlining failure

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 11:18:29 +0100 Michal Hocko wrote: > From: Michal Hocko > > The memory offlining failure reporting is inconsistent and insufficient. > Some error paths simply do not report the failure to the log at all. > When we do report there are no details about the reason of the

Re: [PATCH v2] ubsan: don't mark __ubsan_handle_builtin_unreachable as noreturn

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 17:45:16 +0300 Andrey Ryabinin wrote: > From: Arnd Bergmann > > gcc-8 complains about the prototype for this function: > > lib/ubsan.c:432:1: error: ignoring attribute 'noreturn' in declaration of a > built-in function '__ubsan_handle_builtin_unreachable' because it

Re: [PATCH 2/2] mm/sparse: add common helper to mark all memblocks present

2018-11-07 Thread Andrew Morton
On Wed, 7 Nov 2018 13:36:34 -0700 Logan Gunthorpe wrote: > > Actually if both names suck, then there also is the option to rename both > > instead of adding a comment to explain the suckage. > > Ok, well, I wasn't expecting to take on a big rename like that as it > would create a patch touching

Re: [PATCH 1/2] mm: Introduce common STRUCT_PAGE_MAX_SHIFT define

2018-11-07 Thread Andrew Morton
ignment; > > +/* > + * Used for sizing the vmemmap region on some architectures > + */ > +#define STRUCT_PAGE_MAX_SHIFT(order_base_2(sizeof(struct page))) Much better. Acked-by: Andrew Morton

Re: [PATCH 2/2] mm/sparse: add common helper to mark all memblocks present

2018-11-07 Thread Andrew Morton
memblock_region_memory_end_pfn(reg)); > + } > +} > + I don't like the name much. To me, memblocks_present means "are memblocks present" whereas this actually means "memblocks are present". But whatever. A little covering comment which descr

Re: [PATCH v1 0/4]mm: convert totalram_pages, totalhigh_pages and managed pages to atomic

2018-11-06 Thread Andrew Morton
On Fri, 26 Oct 2018 16:30:58 +0530 Arun KS wrote: > This series convert totalram_pages, totalhigh_pages and > zone->managed_pages to atomic variables. The whole point appears to be removal of managed_page_count_lock, yes? Why? What is the value of this patchset? If "performance" then are any

Re: [PATCH V2] binder: ipc namespace support for android binder

2018-11-06 Thread Andrew Morton
On Mon, 29 Oct 2018 06:18:11 + chouryzhou(周威) wrote: > We are working for running android in container, but we found that binder is > not isolated by ipc namespace. Since binder is a form of IPC and therefore > should > be tied to ipc namespace. With this patch, we can run more than one

Re: [PATCH] fs/proc: introduce /proc/stat2 file

2018-11-06 Thread Andrew Morton
On Mon, 29 Oct 2018 23:04:45 + Daniel Colascione wrote: > On Mon, Oct 29, 2018 at 7:25 PM, Davidlohr Bueso wrote: > > This patch introduces a new /proc/stat2 file that is identical to the > > regular 'stat' except that it zeroes all hard irq statistics. The new > > file is a drop in

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Andrew Morton
On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov wrote: > On success, gen_pool_first_fit_align() returns the bit number such that > chunk_start_addr + (bit << order) is properly aligned. On failure, > the bitmap size parameter is returned. > > When the chunk_start_addr isn't aligned

Re: [PATCH] lib/genaloc: Fix allocation of aligned buffer from non-aligned chunk

2018-11-06 Thread Andrew Morton
On Tue, 6 Nov 2018 14:20:53 +0200 Alexey Skidanov wrote: > On success, gen_pool_first_fit_align() returns the bit number such that > chunk_start_addr + (bit << order) is properly aligned. On failure, > the bitmap size parameter is returned. > > When the chunk_start_addr isn't aligned

Re: [PATCH v4] mm/page_owner: clamp read count to PAGE_SIZE

2018-11-06 Thread Andrew Morton
On Thu, 1 Nov 2018 18:41:33 -0600 William Kucharski wrote: > > > > On Nov 1, 2018, at 3:47 PM, Andrew Morton wrote: > > > > - count = count > PAGE_SIZE ? PAGE_SIZE : count; > > + count = min_t(size_t, count, PAGE_SIZE); > > kbuf = kmallo

Re: [PATCH v8 4/4] Kselftest for module text allocation benchmarking

2018-11-06 Thread Andrew Morton
On Fri, 2 Nov 2018 12:25:20 -0700 Rick Edgecombe wrote: > This adds a test module in lib/, and a script in kselftest that does > benchmarking on the allocation of memory in the module space. Performance here > would have some small impact on kernel module insertions, BPF JIT insertions > and

Re: [PATCH v8 2/4] x86/modules: Increase randomization for modules

2018-11-06 Thread Andrew Morton
On Fri, 2 Nov 2018 12:25:18 -0700 Rick Edgecombe wrote: > This changes the behavior of the KASLR logic for allocating memory for the > text > sections of loadable modules. It randomizes the location of each module text > section with about 17 bits of entropy in typical use. This is enabled on

Re: [PATCH v8 0/4] KASLR feature to randomize each loadable module

2018-11-06 Thread Andrew Morton
On Fri, 2 Nov 2018 12:25:16 -0700 Rick Edgecombe wrote: > This is V8 of the "KASLR feature to randomize each loadable module" patchset. > The purpose is to increase the randomization and also to make the modules > randomized in relation to each other instead of just the base, so that if one >

Re: [PATCH v8 1/4] vmalloc: Add __vmalloc_node_try_addr function

2018-11-06 Thread Andrew Morton
On Fri, 2 Nov 2018 12:25:17 -0700 Rick Edgecombe wrote: > Create __vmalloc_node_try_addr function that tries to allocate at a specific > address without triggering any lazy purging. In order to support this behavior > a try_addr argument was plugged into several of the static helpers. Please

Re: [PATCH] psi: simplify cgroup_move_task

2018-11-05 Thread Andrew Morton
On Sat, 3 Nov 2018 11:33:39 -0700 Olof Johansson wrote: > The existing code triggered an invalid warning about 'rq' possibly being > used uninitialized. Instead of doing the silly warning suppression by > initializa it to NULL, refactor the code to bail out early instead. > > Warning was: > >

Re: [PATCH] z3fold: fix possible reclaim races

2018-11-05 Thread Andrew Morton
age or a page was already released in z3fold_free(). So, the wrong page is encoded in headless, or test_bit does not work properly in z3fold_reclaim_page(). This patch fixed these problems. Link: http://lkml.kernel.org/r/1530853846-30215-1-git-send-email-ks7...@gmail.com Signed-off-by: Jongseok Kim

Re: [PATCH] hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444!

2018-11-05 Thread Andrew Morton
On Mon, 5 Nov 2018 13:23:15 -0800 Mike Kravetz wrote: > This bug has been experienced several times by Oracle DB team. > The BUG is in the routine remove_inode_hugepages() as follows: > /* >* If page is mapped, it was faulted in after being >* unmapped in caller. Unmap

Re: [PATCH] slab.h: Avoid using & for logical and of booleans

2018-11-05 Thread Andrew Morton
On Mon, 5 Nov 2018 12:40:00 -0800 Bart Van Assche wrote: > This patch suppresses the following sparse warning: > > ./include/linux/slab.h:332:43: warning: dubious: x & !y > > ... > > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -329,7 +329,7 @@ static __always_inline enum

Re: [PATCH] mm/mmu_notifier: rename mmu_notifier_synchronize() to <...>_barrier()

2018-11-05 Thread Andrew Morton
On Mon, 5 Nov 2018 11:29:55 -0800 Sean Christopherson wrote: > ...and update its comment to explicitly reference its association with > mmu_notifier_call_srcu(). > > Contrary to its name, mmu_notifier_synchronize() does not synchronize > the notifier's SRCU instance, but rather waits for RCU

Re: [PATCH v4] mm/page_owner: clamp read count to PAGE_SIZE

2018-11-01 Thread Andrew Morton
On Fri, 2 Nov 2018 01:00:07 +0800 wrote: > From: Miles Chen > > The page owner read might allocate a large size of memory with > a large read count. Allocation fails can easily occur when doing > high order allocations. > > Clamp buffer size to PAGE_SIZE to avoid arbitrary size allocation >

Re: [PATCH] memory_hotplug: cond_resched in __remove_pages

2018-10-31 Thread Andrew Morton
On Wed, 31 Oct 2018 13:58:40 +0100 Michal Hocko wrote: > From: Michal Hocko > > We have received a bug report that unbinding a large pmem (>1TB) > can result in a soft lockup: > > ... > > It has been reported on an older (4.12) kernel but the current upstream > code doesn't cond_resched in

Re: [LKP] [mm] 68c37ccedc: BUG:kernel_hang_in_early-boot_stage,last_printk:early_console_in_setup_code

2018-10-29 Thread Andrew Morton
On Mon, 29 Oct 2018 21:15:01 +0800 kernel test robot wrote: > FYI, we noticed the following commit (built with gcc-7): > > commit: 68c37ccedcde10514898f4ba3b28c0de85c590d1 ("mm: nobootmem: remove > bootmem allocation APIs") > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git

Re: [RFC PATCH] mm: don't reclaim inodes with many attached pages

2018-10-25 Thread Andrew Morton
On Thu, 25 Oct 2018 11:23:52 +0200 Michal Hocko wrote: > On Wed 24-10-18 15:19:50, Andrew Morton wrote: > > On Tue, 23 Oct 2018 16:43:29 + Roman Gushchin wrote: > > > > > Spock reported that the commit 172b06c32b94 ("mm: slowly shrink slabs > > > wit

Re: [PATCH] z3fold: encode object length in the handle

2018-10-25 Thread Andrew Morton
On Thu, 25 Oct 2018 11:28:21 +0200 Vitaly Wool wrote: > Reclaim and free can race on an object (which is basically ok) but > in order for reclaim to be able to map "freed" object we need to > encode object length in the handle. handle_to_chunks() is thus > introduced to extract object length

Re: [PATCH 2/2] mm, thp: consolidate THP gfp handling into alloc_hugepage_direct_gfpmask

2018-10-25 Thread Andrew Morton
On October 25, 2018 9:14:10 AM PDT, Michal Hocko wrote: >Andrew. Do you want me to repost the patch or you plan to update the >changelog yourself? Please send a replacement changelog and I'll paste it in?

Re: [PATCH 2/2] mm, thp: consolidate THP gfp handling into alloc_hugepage_direct_gfpmask

2018-10-24 Thread Andrew Morton
On Mon, 22 Oct 2018 15:27:54 +0200 Vlastimil Babka wrote: > > : Moreover the oriinal code allowed to trigger > > : WARN_ON_ONCE(policy->mode == MPOL_BIND && (gfp & __GFP_THISNODE)); > > : in policy_node if the requested node (e.g. cpu local one) was outside of > > : the mbind nodemask. This is

Re: [PATCH 3/6] mm/hmm: fix race between hmm_mirror_unregister() and mmu_notifier callback

2018-10-24 Thread Andrew Morton
off-by: Ralph Campbell > Reviewed-by: John Hubbard > Reviewed-by: Jérôme Glisse > Reviewed-by: Balbir Singh > Cc: Andrew Morton > Cc: sta...@vger.kernel.org I added your Signed-off-by: to this one. It's required since you were on the patch delivery path.

Re: [RFC PATCH 0/2] improve vmalloc allocation

2018-10-24 Thread Andrew Morton
On Fri, 19 Oct 2018 19:35:36 +0200 "Uladzislau Rezki (Sony)" wrote: > improving vmalloc allocator It's about time ;) Are you aware of https://lwn.net/Articles/285341/ ? If not, please do take a look through Nick's work and see if there are any good things there which can be borrowed.

  1   2   3   4   5   6   7   8   9   10   >