[PATCH] tile 32-bit big-endian: fix bugs in syscall argument order

2016-06-15 Thread Chris Metcalf
The glibc __LONG_LONG_PAIR passes arguments in a different order for BE platforms vs LE platforms. Adjust the expectations in the kernel 32-bit syscall routines for BE to match. Signed-off-by: Chris Metcalf --- arch/tile/kernel/compat.c | 35 ++- arch/tile/kernel

Re: [RFC PATCH-tip v2 5/6] locking/rwsem: Change RWSEM_WAITING_BIAS for better disambiguation

2016-06-15 Thread Waiman Long
On 06/15/2016 01:45 PM, Peter Zijlstra wrote: On Tue, Jun 14, 2016 at 06:48:08PM -0400, Waiman Long wrote: +++ b/arch/alpha/include/asm/rwsem.h @@ -17,9 +17,9 @@ #define RWSEM_UNLOCKED_VALUE 0xL #define RWSEM_ACTIVE_BIAS 0x0001L #define RWSE

Re: [PATCH 02/13] irq: Introduce IRQD_AFFINITY_MANAGED flag

2016-06-15 Thread Bart Van Assche
On 06/15/2016 06:03 PM, Keith Busch wrote: On Wed, Jun 15, 2016 at 05:28:54PM +0200, Bart Van Assche wrote: On 06/15/2016 05:14 PM, Keith Busch wrote: I think the idea is have the irq_affinity mask match the CPU mapping on the submission side context associated with that particular vector. If t

Re: stack validation warning on lttng-modules bytecode interpreter

2016-06-15 Thread Josh Poimboeuf
On Wed, Jun 15, 2016 at 07:13:39PM +, Mathieu Desnoyers wrote: > - On Jun 15, 2016, at 2:18 PM, Josh Poimboeuf jpoim...@redhat.com wrote: > > > On Wed, Jun 15, 2016 at 04:55:16PM +, Mathieu Desnoyers wrote: > >> Hi Josh, > >> > >> I notice that with gcc 6.1.1, kernel 4.6, with > >> CO

Re: [RFC PATCH-tip v2 3/6] locking/rwsem: Enable count-based spinning on reader

2016-06-15 Thread Waiman Long
On 06/15/2016 01:38 PM, Peter Zijlstra wrote: On Tue, Jun 14, 2016 at 06:48:06PM -0400, Waiman Long wrote: static bool rwsem_optimistic_spin(struct rw_semaphore *sem) { - bool taken = false; + bool taken = false, can_spin; I would place the variables without assignment first.

Re: [PATCH v5] ASoC: rockchip: Add machine driver for RK3399 GRU Boards

2016-06-15 Thread Steve Barber
On Mon, Jun 13, 2016 at 1:42 AM, Xing Zheng wrote: > Because we need to support the multiple codecs (MAX98357A/RT5514/DA7219) > on the RK3399 GRU boards, this patch can help us to support these codecs. > > Signed-off-by: Xing Zheng > --- > > Changes in v5: > - fix the build warning for missing I2

[PATCH v3 0/4] dell-wmi: Changes in WMI event code handling

2016-06-15 Thread Pali Rohár
First patch describe problem about 0xe045 code. Second and third are just cosmetic and last rework code which processing WMI events. It should be properly tested on more Dell machines, to check that everything is still working correctly. Changes since v2: * Updated description for 2/4 and 4/4 * Fi

[PATCH v3 4/4] dell-wmi: Generate one sparse keymap for all machines

2016-06-15 Thread Pali Rohár
This patch reworks code for generating sparse keymap and processing WMI events. It unifies procedure for generating sparse keymap and also unifies big switch code for processing WMI events of different types. After this patch dell-wmi driver does not differ between "old" and "new" hotkey type. It

[PATCH v3 2/4] dell-wmi: Sort WMI event codes and update comments

2016-06-15 Thread Pali Rohár
For better readability of keymap table, sort events by codes and also update comments for events to be more informative. Signed-off-by: Pali Rohár Tested-by: Michał Kępień Reviewed-by: Michał Kępień --- drivers/platform/x86/dell-wmi.c | 29 - 1 file changed, 16 in

[PATCH v3 1/4] dell-wmi: Ignore WMI event code 0xe045

2016-06-15 Thread Pali Rohár
>From Dell we know that WMI event code 0xe045 is for Num Lock key, but it is unclear due to message in commit 0b3f6109f0c9 ("dell-wmi: new driver for hotkey control"). Signed-off-by: Pali Rohár Tested-by: Michał Kępień Reviewed-by: Michał Kępień Cc: Matthew Garrett Cc: Mario Limonciello Link:

[PATCH v3 3/4] dell-wmi: Add information about other WMI event codes

2016-06-15 Thread Pali Rohár
ACPI DSDT tables have defined other WMI codes, but does not contain any description when those codes are emitted. Some other codes can be found in logs on internet. In this patch are all which I saw, but lot of them are not tested properly (e.g. for duplicate events with AT keyboard). Now we have a

Re: [PATCH 3/4] dell-wmi: Add information about other WMI event codes

2016-06-15 Thread Pali Rohár
On Wednesday 08 June 2016 12:44:44 Gabriele Mazzotta wrote: > On 08/06/2016 08:02, mario_limoncie...@dell.com wrote: > >> -Original Message- > >> From: Pali Rohár [mailto:pali.ro...@gmail.com] > >> Sent: Tuesday, June 7, 2016 6:00 PM > >> To: Gabriele Mazzotta ; Limonciello, Mario > >> > >

Re: [PATCH] tools/perf: fix the word selected in find_*_bit

2016-06-15 Thread Yury Norov
Hi Madhavan, On Wed, Jun 15, 2016 at 05:12:53PM +0530, Madhavan Srinivasan wrote: > When decoding the perf_regs mask in regs_dump__printf(), > we loop through the mask using find_first_bit and find_next_bit functions. > And mask is of type "u64". But "u64" is send as a "unsigned long *" to > lib f

Re: [PATCH v2 0/5] ipvs: fix backup sync daemon with IPv6, and minor updates

2016-06-15 Thread Julian Anastasov
Hello, On Wed, 15 Jun 2016, Quentin Armitage wrote: > I am updating the patches in line with your comments, but I'm not sure about > a couple of points. > > Patch 4: > > You state that before bind(), such changes should be safe. However, from the > function make_send_sock(), when the f

Re: [PATCH 02/13] irq: Introduce IRQD_AFFINITY_MANAGED flag

2016-06-15 Thread Keith Busch
On Wed, Jun 15, 2016 at 09:36:54PM +0200, Bart Van Assche wrote: > Sorry that I had not yet this made this clear but my concern is about a > system equipped with two or more adapters and with more CPU cores than the > number of MSI-X interrupts per adapter. Consider e.g. a system with two > adapter

Re: [Cocci] [PATCH v3 4/6] coccicheck: add indexing enhancement options

2016-06-15 Thread Luis R. Rodriguez
On Wed, Jun 15, 2016 at 01:20:19PM +0200, SF Markus Elfring wrote: > > +DIR=$(dirname $(readlink -f $0)) > > +DIR="${DIR}/../" > > How do you think about to merge these variable assignments also into one? > > +DIR="$(dirname $(readlink -f $0))/../" Sure. Luis

Re: acpi: broken suspend to RAM with v4.7-rc1

2016-06-15 Thread Andrey Skvortsov
On 15 Jun, Zheng, Lv wrote: > Hi, Rafael > > > From: rjwyso...@gmail.com [mailto:rjwyso...@gmail.com] On Behalf Of > > Rafael J. Wysocki > > Subject: Re: acpi: broken suspend to RAM with v4.7-rc1 > > > > On Mon, Jun 13, 2016 at 12:07 PM, Andrey Skvortsov > > wrote: > > > Hi Lv, > > > > > > On 13

Re: [PATCH 02/13] irq: Introduce IRQD_AFFINITY_MANAGED flag

2016-06-15 Thread Keith Busch
On Wed, Jun 15, 2016 at 04:06:55PM -0400, Keith Busch wrote: > > > > 0: A0 B0 > > 1: A1 B1 > > 2: A2 B2 > > 3: A3 B3 > > 4: A4 B4 > > 5: A5 B5 > > 6: A6 B6 > > 7: A7 B7 > > 8: (none) > > ... > > 31: (none) > > I'll need to look at the follow on patches do to confirm, but that's > not what this sh

Re: [RFC PATCH-tip v2 1/6] locking/osq: Make lock/unlock proper acquire/release barrier

2016-06-15 Thread Waiman Long
On 06/15/2016 03:08 PM, Waiman Long wrote: On 06/15/2016 01:12 PM, Peter Zijlstra wrote: On Wed, Jun 15, 2016 at 09:56:59AM -0700, Davidlohr Bueso wrote: On Tue, 14 Jun 2016, Waiman Long wrote: +++ b/kernel/locking/osq_lock.c @@ -115,7 +115,7 @@ bool osq_lock(struct optimistic_spin_queue *lock

Re: [PATCH v2] Linux VM workaround for Knights Landing A/D leak

2016-06-15 Thread Nadav Amit
Lukasz wrote: > From: Nadav Amit [mailto:nadav.a...@gmail.com] > Sent: Tuesday, June 14, 2016 8:38 PM > >>> + pte_t pte = ptep_get_and_clear(mm, addr, ptep); >>> + >>> + if (boot_cpu_has_bug(X86_BUG_PTE_LEAK)) >>> + fix_pte_leak(mm, addr, ptep); >>> + return pte; >>> } >> >> I

Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

2016-06-15 Thread Russell King - ARM Linux
On Wed, Jun 15, 2016 at 09:29:38PM +0200, Daniel Vetter wrote: > On Wed, Jun 15, 2016 at 7:21 PM, Liviu Dudau wrote: > > Could be the tda998x_drv fault, but I'm getting this splat: > > Yeah, tda9998x needs to be fixed to _not_ register it's connector > before the overall (componentized) driver is

[PATCHv9-rebased2 01/37] mm, thp: make swapin readahead under down_read of mmap_sem

2016-06-15 Thread Kirill A. Shutemov
From: Ebru Akagunduz Currently khugepaged makes swapin readahead under down_write. This patch supplies to make swapin readahead under down_read instead of down_write. The patch was tested with a test program that allocates 800MB of memory, writes to it, and then sleeps. The system was forced t

[PATCHv9-rebased2 20/37] thp, mlock: do not mlock PTE-mapped file huge pages

2016-06-15 Thread Kirill A. Shutemov
As with anon THP, we only mlock file huge pages if we can prove that the page is not mapped with PTE. This way we can avoid mlock leak into non-mlocked vma on split. We rely on PageDoubleMap() under lock_page() to check if the the page may be PTE mapped. PG_double_map is set by page_add_file_rmap(

[PATCHv9-rebased2 03/37] mm, thp: fix locking inconsistency in collapse_huge_page

2016-06-15 Thread Kirill A. Shutemov
From: Ebru Akagunduz After creating revalidate vma function, locking inconsistency occured due to directing the code path to wrong label. This patch directs to correct label and fix the inconsistency. Related commit that caused inconsistency: http://git.kernel.org/cgit/linux/kernel/git/next/linu

[PATCHv9-rebased2 30/37] shmem, thp: respect MADV_{NO,}HUGEPAGE for file mappings

2016-06-15 Thread Kirill A. Shutemov
Let's wire up existing madvise() hugepage hints for file mappings. MADV_HUGEPAGE advise shmem to allocate huge page on page fault in the VMA. It only has effect if the filesystem is mounted with huge=advise or huge=within_size. MADV_NOHUGEPAGE prevents hugepage from being allocated on page fault

[PATCHv9-rebased2 36/37] shmem: split huge pages beyond i_size under memory pressure

2016-06-15 Thread Kirill A. Shutemov
Even if user asked to allocate huge pages always (huge=always), we should be able to free up some memory by splitting pages which are partly byound i_size if memory presure comes or once we hit limit on filesystem size (-o size=). In order to do this we maintain per-superblock list of inodes, whic

[PATCHv9-rebased2 15/37] thp: handle file COW faults

2016-06-15 Thread Kirill A. Shutemov
File COW for THP is handled on pte level: just split the pmd. It's not clear how benefitial would be allocation of huge pages on COW faults. And it would require some code to make them work. I think at some point we can consider teaching khugepaged to collapse pages in COW mappings, but allocatin

[PATCHv9-rebased2 35/37] thp: introduce CONFIG_TRANSPARENT_HUGE_PAGECACHE

2016-06-15 Thread Kirill A. Shutemov
For file mappings, we don't deposit page tables on THP allocation because it's not strictly required to implement split_huge_pmd(): we can just clear pmd and let following page faults to reconstruct the page table. But Power makes use of deposited page table to address MMU quirk. Let's hide THP p

Re: [PATCH V7 8/9] vfio: platform: check reset call return code during open

2016-06-15 Thread Auger Eric
Hi Sinan, On 13/06/2016 06:26, Sinan Kaya wrote: > Open call is ignoring the return code from reset call and can > potentially continue even though reset call failed. > > If reset_required module parameter is set, this patch is going > to validate the return code and will abort open if reset fail

Re: [PATCH v3 2/2] ASoC: msm8916: Add msm8916-wcd codec driver

2016-06-15 Thread Kenneth Westfield
On Wed, Jun 15, 2016 at 10:31:36AM +0100, Mark Brown wrote: > On Wed, Jun 15, 2016 at 10:16:27AM +0100, Srinivas Kandagatla wrote: > > On 14/06/16 16:59, Mark Brown wrote: > > > On Fri, Jun 10, 2016 at 07:18:45PM +0100, Srinivas Kandagatla wrote: > > In theory there are 3 devices, > > one is the p

Re: [PATCH v2] Linux VM workaround for Knights Landing A/D leak

2016-06-15 Thread Dave Hansen
On 06/15/2016 01:04 PM, Nadav Amit wrote: > Be careful here. According to the SDM when invalidating a huge-page, > each 4KB page needs to be invalidated separately. In practice, when > Linux invalidates 2MB/1GB pages it performs a full TLB flush. The > full flush may not be required on knights land

[PATCH] arm/arm64/irqchip/pci: fix PCI_MSI dependencies

2016-06-15 Thread Arnd Bergmann
The PCI_MSI symbol is used inconsistently throughout the tree, with some drivers using 'select' and others using 'depends on', or using conditional selects. This keeps causing problems, and the latest one is a result of ARCH_ALPINE using a 'select' statement to enable its platform specific MSI driv

[PATCHv9-rebased2 37/37] thp: update Documentation/{vm/transhuge,filesystems/proc}.txt

2016-06-15 Thread Kirill A. Shutemov
Add info about tmpfs/shmem with huge pages. Signed-off-by: Kirill A. Shutemov --- Documentation/filesystems/proc.txt | 9 +++ Documentation/vm/transhuge.txt | 128 ++--- 2 files changed, 101 insertions(+), 36 deletions(-) diff --git a/Documentation/filesyst

[PATCHv9-rebased2 23/37] radix-tree: implement radix_tree_maybe_preload_order()

2016-06-15 Thread Kirill A. Shutemov
The new helper is similar to radix_tree_maybe_preload(), but tries to preload number of nodes required to insert (1 << order) continuous naturally-aligned elements. This is required to push huge pages into pagecache. Signed-off-by: Kirill A. Shutemov --- include/linux/radix-tree.h | 1 + lib/r

[PATCHv9-rebased2 32/37] khugepaged: move up_read(mmap_sem) out of khugepaged_alloc_page()

2016-06-15 Thread Kirill A. Shutemov
Both variants of khugepaged_alloc_page() do up_read(&mm->mmap_sem) first: no point keep it inside the function. Signed-off-by: Kirill A. Shutemov --- mm/khugepaged.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c

[PATCHv9-rebased2 18/37] thp: run vma_adjust_trans_huge() outside i_mmap_rwsem

2016-06-15 Thread Kirill A. Shutemov
vma_addjust_trans_huge() splits pmd if it's crossing VMA boundary. During split we munlock the huge page which requires rmap walk. rmap wants to take the lock on its own. Let's move vma_adjust_trans_huge() outside i_mmap_rwsem to fix this. Signed-off-by: Kirill A. Shutemov --- mm/mmap.c | 4 ++-

[PATCHv9-rebased2 33/37] shmem: make shmem_inode_info::lock irq-safe

2016-06-15 Thread Kirill A. Shutemov
We are going to need to call shmem_charge() under tree_lock to get accoutning right on collapse of small tmpfs pages into a huge one. The problem is that tree_lock is irq-safe and lockdep is not happy, that we take irq-unsafe lock under irq-safe[1]. Let's convert the lock to irq-safe. [1] https:

[PATCHv9-rebased2 31/37] thp: extract khugepaged from mm/huge_memory.c

2016-06-15 Thread Kirill A. Shutemov
khugepaged implementation grew to the point when it deserve separate file in source. Let's move it to mm/khugepaged.c. Signed-off-by: Kirill A. Shutemov --- include/linux/huge_mm.h| 10 + include/linux/khugepaged.h |5 + mm/Makefile|2 +- mm/huge_memory.c

[PATCHv9-rebased2 26/37] mm, rmap: account shmem thp pages

2016-06-15 Thread Kirill A. Shutemov
Let's add ShmemHugePages and ShmemPmdMapped fields into meminfo and smaps. It indicates how many times we allocate and map shmem THP. NR_ANON_TRANSPARENT_HUGEPAGES is renamed to NR_ANON_THPS. Signed-off-by: Kirill A. Shutemov --- drivers/base/node.c| 13 + fs/proc/meminfo.c

[PATCHv9-rebased2 27/37] shmem: prepare huge= mount option and sysfs knob

2016-06-15 Thread Kirill A. Shutemov
This patch adds new mount option "huge=". It can have following values: - "always": Attempt to allocate huge pages every time we need a new page; - "never": Do not allocate huge pages; - "within_size": Only allocate huge page if it will be fully within i_size.

[PATCHv9-rebased2 34/37] khugepaged: add support of collapse for tmpfs/shmem pages

2016-06-15 Thread Kirill A. Shutemov
This patch extends khugepaged to support collapse of tmpfs/shmem pages. We share fair amount of infrastructure with anon-THP collapse. Few design points: - First we are looking for VMA which can be suitable for mapping huge page; - If the VMA maps shmem file, the rest scan/collapse opera

[PATCHv9-rebased2 16/37] thp: skip file huge pmd on copy_huge_pmd()

2016-06-15 Thread Kirill A. Shutemov
copy_page_range() has a check for "Don't copy ptes where a page fault will fill them correctly." It works on VMA level. We still copy all page table entries from private mappings, even if they map page cache. We can simplify copy_huge_pmd() a bit by skipping file PMDs. We don't map file private p

Re: [PATCH] selftests/exec: Makefile is a run-time dependency, add it to the install list

2016-06-15 Thread Shuah Khan
On 06/15/2016 12:36 PM, Yannick Brosseau wrote: > The execveat test try to exec the Makefile file and expect an EACCES results. > When running > the test in the installed destination it would fail with ENOENT since the > file is > not there. > Add Makefile to the TEST_FILES list so it's copied at

[PATCHv9-rebased2 28/37] shmem: get_unmapped_area align huge page

2016-06-15 Thread Kirill A. Shutemov
From: Hugh Dickins Provide a shmem_get_unmapped_area method in file_operations, called at mmap time to decide the mapping address. It could be conditional on CONFIG_TRANSPARENT_HUGEPAGE, but save #ifdefs in other places by making it unconditional. shmem_get_unmapped_area() first calls the usual

[PATCHv9-rebased2 21/37] vmscan: split file huge pages before paging them out

2016-06-15 Thread Kirill A. Shutemov
This is preparation of vmscan for file huge pages. We cannot write out huge pages, so we need to split them on the way out. Signed-off-by: Kirill A. Shutemov --- mm/vmscan.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 93ba33789ac6..21d417ccff69 10064

Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

2016-06-15 Thread Russell King - ARM Linux
On Wed, Jun 15, 2016 at 06:21:04PM +0100, Liviu Dudau wrote: > Could be the tda998x_drv fault, but I'm getting this splat: > > [1.347687] kobject_add_internal failed for card0-HDMI-A-1 (error: -2 > parent: card0) Right, so this is -ENOENT - I expect that it's complaining that the parent does

[PATCHv9-rebased2 25/37] truncate: handle file thp

2016-06-15 Thread Kirill A. Shutemov
For shmem/tmpfs we only need to tweak truncate_inode_page() and invalidate_mapping_pages(). truncate_inode_pages_range() and invalidate_inode_pages2_range() are adjusted to use page_to_pgoff(). Signed-off-by: Kirill A. Shutemov --- mm/truncate.c | 28 +++- 1 file changed

[PATCHv9-rebased2 19/37] thp: file pages support for split_huge_page()

2016-06-15 Thread Kirill A. Shutemov
Basic scheme is the same as for anon THP. Main differences: - File pages are on radix-tree, so we have head->_count offset by HPAGE_PMD_NR. The count got distributed to small pages during split. - mapping->tree_lock prevents non-lockless access to pages under split over radix-tree;

[PATCHv9-rebased2 17/37] thp: prepare change_huge_pmd() for file thp

2016-06-15 Thread Kirill A. Shutemov
change_huge_pmd() has assert which is not relvant for file page. For shared mapping it's perfectly fine to have page table entry writable, without explicit mkwrite. Signed-off-by: Kirill A. Shutemov --- mm/huge_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/hug

[PATCH] amdgpu: use NULL instead of 0 for pointer

2016-06-15 Thread Arnd Bergmann
In the AMD powerplay driver, a pointer is checked for validity by comparing against an integer '0', which causes a harmless warning when building with "make W=1": drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werr

[PATCHv9-rebased2 13/37] thp: support file pages in zap_huge_pmd()

2016-06-15 Thread Kirill A. Shutemov
split_huge_pmd() for file mappings (and DAX too) is implemented by just clearing pmd entry as we can re-fill this area from page cache on pte level later. This means we don't need deposit page tables when file THP is mapped. Therefore we shouldn't try to withdraw a page table on zap_huge_pmd() fil

[PATCHv9-rebased2 14/37] thp: handle file pages in split_huge_pmd()

2016-06-15 Thread Kirill A. Shutemov
Splitting THP PMD is simple: just unmap it as in DAX case. This way we can avoid memory overhead on page table allocation to deposit. It's probably a good idea to try to allocation page table with GFP_ATOMIC in __split_huge_pmd_locked() to avoid refaulting the area, but clearing pmd should be good

[PATCHv9-rebased2 24/37] filemap: prepare find and delete operations for huge pages

2016-06-15 Thread Kirill A. Shutemov
For now, we would have HPAGE_PMD_NR entries in radix tree for every huge page. That's suboptimal and it will be changed to use Matthew's multi-order entries later. 'add' operation is not changed, because we don't need it to implement hugetmpfs: shmem uses its own implementation. Signed-off-by: Ki

[PATCHv9-rebased2 29/37] shmem: add huge pages support

2016-06-15 Thread Kirill A. Shutemov
Here's basic implementation of huge pages support for shmem/tmpfs. It's all pretty streight-forward: - shmem_getpage() allcoates huge page if it can and try to inserd into radix tree with shmem_add_to_page_cache(); - shmem_add_to_page_cache() puts the page onto radix-tree if there's

Re: [PATCH 0/8] Lustre: Multiple assignments removal.

2016-06-15 Thread Luis de Bethencourt
On 10/06/16 03:35, Oleg Drokin wrote: > These patches remove multiple assignments in Lustre, that makes > checkpatch (somewhat understandably) unhappy. > > Nathaniel Clark (8): > staging/lustre/osc: Fix Multiple Assignment Warnings > staging/lustre/fid: Fix Multiple Assignments > staging/lus

[PATCHv9-rebased2 08/37] mm: introduce fault_env

2016-06-15 Thread Kirill A. Shutemov
The idea borrowed from Peter's patch from patchset on speculative page faults[1]: Instead of passing around the endless list of function arguments, replace the lot with a single structure so we can change context without endless function signature changes. The changes are mostly mechanical with e

[PATCHv9-rebased2 22/37] page-flags: relax policy for PG_mappedtodisk and PG_reclaim

2016-06-15 Thread Kirill A. Shutemov
These flags are in use for file THP. Signed-off-by: Kirill A. Shutemov --- include/linux/page-flags.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 8cf09639185a..74e4dda91238 100644 --- a/include/linux/page

[PATCHv9-rebased2 05/37] khugepaged: recheck pmd after mmap_sem re-acquired

2016-06-15 Thread Kirill A. Shutemov
Vlastimil noted[1] that pmd can be no longer valid after we drop mmap_sem. We need recheck it once mmap_sem taken again. [1] http://lkml.kernel.org/r/12918dcd-a695-c6f4-e06f-69141c5f3...@suse.cz Signed-off-by: Kirill A. Shutemov --- mm/huge_memory.c | 6 ++ 1 file changed, 6 insertions(+)

[PATCH] trace-cmd record: add --max-graph-depth option

2016-06-15 Thread Omar Sandoval
From: Omar Sandoval This is exposed in debugfs but there's no quick way to set it with trace-cmd. While we're adding support for this, fix --profile so it sets max_graph_depth back to whatever it was before. Signed-off-by: Omar Sandoval --- Documentation/trace-cmd-record.1.txt | 5 trace

[PATCHv9-rebased2 07/37] mm: do not pass mm_struct into handle_mm_fault

2016-06-15 Thread Kirill A. Shutemov
We always have vma->vm_mm around. Signed-off-by: Kirill A. Shutemov --- arch/alpha/mm/fault.c | 2 +- arch/arc/mm/fault.c | 2 +- arch/arm/mm/fault.c | 2 +- arch/arm64/mm/fault.c | 2 +- arch/avr32/mm/fault.c | 2 +- arch/cris/mm/fault.c

[PATCH] nilfs: avoid warning about unused variables

2016-06-15 Thread Arnd Bergmann
The newly added nilfs_msg() infrastructure caused a warning in nilfs_clear_dirty_page() when it is disabled: fs/nilfs2/page.c: In function 'nilfs_clear_dirty_page': fs/nilfs2/page.c:402:22: error: unused variable 'sb' [-Werror=unused-variable] struct super_block *sb = inode->i_sb; We can avoid

[PATCHv9-rebased2 10/37] rmap: support file thp

2016-06-15 Thread Kirill A. Shutemov
Naive approach: on mapping/unmapping the page as compound we update ->_mapcount on each 4k page. That's not efficient, but it's not obvious how we can optimize this. We can look into optimization later. PG_double_map optimization doesn't work for file pages since lifecycle of file pages is differe

[PATCHv9-rebased2 12/37] thp, vmstats: add counters for huge file pages

2016-06-15 Thread Kirill A. Shutemov
THP_FILE_ALLOC: how many times huge page was allocated and put page cache. THP_FILE_MAPPED: how many times file huge page was mapped. Signed-off-by: Kirill A. Shutemov --- include/linux/vm_event_item.h | 7 +++ mm/memory.c | 1 + mm/vmstat.c | 2 ++ 3 fil

[PATCHv9-rebased2 11/37] mm: introduce do_set_pmd()

2016-06-15 Thread Kirill A. Shutemov
With postponed page table allocation we have chance to setup huge pages. do_set_pte() calls do_set_pmd() if following criteria met: - page is compound; - pmd entry in pmd_none(); - vma has suitable size and alignment; Signed-off-by: Kirill A. Shutemov --- include/linux/huge_mm.h | 2 ++ mm/

[PATCHv9-rebased2 09/37] mm: postpone page table allocation until we have page to map

2016-06-15 Thread Kirill A. Shutemov
The idea (and most of code) is borrowed again: from Hugh's patchset on huge tmpfs[1]. Instead of allocation pte page table upfront, we postpone this until we have page to map in hands. This approach opens possibility to map the page as huge if filesystem supports this. Comparing to Hugh's patch I

[PATCHv9-rebased2 02/37] mm-thp-make-swapin-readahead-under-down_read-of-mmap_sem-fix

2016-06-15 Thread Kirill A. Shutemov
Passing 'vma' to hugepage_vma_revlidate() is useless. It doesn't make use of it anyway. Link: http://lkml.kernel.org/r/20160530095058.ga53...@black.fi.intel.com Cc: Ebru Akagunduz Cc: Hugh Dickins Cc: Michal Hocko Signed-off-by: Andrew Morton --- mm/huge_memory.c | 11 +-- 1 file ch

[PATCHv9-rebased2 00/37] THP-enabled tmpfs/shmem using compound pages

2016-06-15 Thread Kirill A. Shutemov
Andrew, As requested, here's refreshed version of the patchset. During preparation, Ebru mentionedi (on irc) on that she wanted to withdraw mm-thp-avoid-unnecessary-swapin-in-khugepaged.patch from mm tree, but it's difficult in current state of the tree. So I did rebase removing the patch. The p

[PATCHv9-rebased2 06/37] thp, mlock: update unevictable-lru.txt

2016-06-15 Thread Kirill A. Shutemov
Add description of THP handling into unevictable-lru.txt. Signed-off-by: Kirill A. Shutemov --- Documentation/vm/unevictable-lru.txt | 21 + 1 file changed, 21 insertions(+) diff --git a/Documentation/vm/unevictable-lru.txt b/Documentation/vm/unevictable-lru.txt index fa3b5

[PATCHv9-rebased2 04/37] mm-thp-make-swapin-readahead-under-down_read-of-mmap_sem-fix-2-fix

2016-06-15 Thread Kirill A. Shutemov
From: Andrew Morton update comment to match new code Cc: Andrea Arcangeli Cc: Ebru Akagunduz Cc: Kirill A. Shutemov Cc: Rik van Riel Cc: Sergey Senozhatsky Cc: Stephen Rothwell Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/huge_memory.c | 6 +++--- 1 file changed, 3 insertions

[PATCH 3/3] drivers/media/media-device: fix double free bug in _unregister()

2016-06-15 Thread Max Kellermann
While removing all interfaces in media_device_unregister(), all media_interface pointers are freed. This is illegal and results in double kfree() if any media_interface is still linked at this point; maybe because a userspace process still has a file handle. Once the process closes the file handl

[PATCH 2/3] drivers/media/media-entity: clear media_gobj.mdev in _destroy()

2016-06-15 Thread Max Kellermann
media_gobj_destroy() may be called twice on one instance - once by media_device_unregister() and again by dvb_media_device_free(). The function media_remove_intf_links() establishes and documents the convention that mdev==NULL means that the object is not registered, but nobody ever NULLs this var

Re: [PATCH] ses: Fix racy cleanup of /sys in remove_dev()

2016-06-15 Thread Calvin Owens
On Thursday 06/02 at 15:50 -0700, Calvin Owens wrote: > On 05/13/2016 01:28 PM, Calvin Owens wrote: > > Currently we free the resources backing the enclosure device before we > > call device_unregister(). This is racy: during rmmod of low-level SCSI > > drivers that hook into enclosure, we end up w

Re: [PATCH 1/1] selinuxfs: fix type mismatch

2016-06-15 Thread Paul Moore
On Fri, Jun 10, 2016 at 5:14 PM, Heinrich Schuchardt wrote: > avc_cache_threshold is of type unsigned int. > > Do not use a signed new_value in > sscanf(page, "%u", &new_value). > > Signed-off-by: Heinrich Schuchardt > --- > security/selinux/selinuxfs.c | 2 +- > 1 file changed, 1 insertion(+),

Re: stack validation warning on lttng-modules bytecode interpreter

2016-06-15 Thread Josh Poimboeuf
On Wed, Jun 15, 2016 at 08:01:09PM +, Mathieu Desnoyers wrote: > - On Jun 15, 2016, at 3:38 PM, Josh Poimboeuf jpoim...@redhat.com wrote: > > > On Wed, Jun 15, 2016 at 07:13:39PM +, Mathieu Desnoyers wrote: > >> - On Jun 15, 2016, at 2:18 PM, Josh Poimboeuf jpoim...@redhat.com > >

Re: [PATCH] init, allow blacklisting of module_init functions

2016-06-15 Thread Rasmus Villemoes
On Wed, Jun 15 2016, Prarit Bhargava wrote: > At some point I was 100% sure this worked. I do remember testing it against > just a loadable module and had positive testing results. I think the current %ps/%pf behaviour was introduced in 4796dd200db9 (way back in 2012). > In any case this is a

[PATCH v2] ARM: mm: fix location of _etext

2016-06-15 Thread Kees Cook
The _etext position is defined to be the end of the kernel text code, and should not include any part of the data segments. This interferes with things that might check memory ranges and expect executable code up to _etext. Just to be conservative, leave the kernel resource as it was, using __init_

[PATCH 1/3] drivers/media/dvb-core/en50221: use kref to manage struct dvb_ca_private

2016-06-15 Thread Max Kellermann
Don't free the object until the file handle has been closed. Fixes use-after-free bug which occurs when I disconnect my DVB-S received while VDR is running. Signed-off-by: Max Kellermann --- drivers/media/dvb-core/dvb_ca_en50221.c | 24 +++- 1 file changed, 23 insertions(+

Re: [PATCH] staging:vt6656:card.c:Fix comment block issue

2016-06-15 Thread Luis de Bethencourt
On 11/06/16 21:08, Rithvik Patibandla wrote: > Fix "Block comments use * on subsequent lines" and "Block comments use > */ on trailing lines" warnings thrown by checkpatch.pl > > Signed-off-by: Rithvik Patibandla > --- > drivers/staging/vt6656/card.c | 3 ++- > 1 file changed, 2 insertions(+), 1

Re: [patch 00/20] timer: Refactor the timer wheel

2016-06-15 Thread Paul E. McKenney
On Wed, Jun 15, 2016 at 07:02:38PM +0200, Thomas Gleixner wrote: > On Wed, 15 Jun 2016, Paul E. McKenney wrote: > > On Mon, Jun 13, 2016 at 09:15:14AM -0700, Paul E. McKenney wrote: > > > On Mon, Jun 13, 2016 at 08:40:50AM -, Thomas Gleixner wrote: > > > > The current timer wheel has some drawb

Re: [PATCH 2/2] iommu/amd: Destroy api_lock mutex when freeing domain

2016-06-15 Thread Vesely, Jan
On Wed, 2016-06-15 at 13:54 +0200, j...@8bytes.org wrote: > On Thu, Jun 09, 2016 at 03:48:44PM +, Vesely, Jan wrote: > > On Sat, 2016-05-21 at 14:11 -0400, Jan Vesely wrote: > > > From: Jan Vesely > > > > > > Signed-off-by: Jan Vesely > > > --- > > >  drivers/iommu/amd_iommu.c | 1 + > > >  1

Re: stack validation warning on lttng-modules bytecode interpreter

2016-06-15 Thread Josh Poimboeuf
On Wed, Jun 15, 2016 at 03:24:52PM -0500, Josh Poimboeuf wrote: > Thanks, figured it out. It was an objtool bug. It was expecting the > macro to create a section symbol (STT_SECTION), but for some reason this > file's use of the macro creates a function symbol (STT_FUNC). Actually, to be precise

[PATCH v2] powerpc/pseries: start rtasd before PCI probing

2016-06-15 Thread Greg Kurz
A strange behaviour is observed when comparing PCI hotplug in QEMU, between x86 and pseries. If you consider the following steps: - start a VM - add a PCI device via the QEMU monitor before the rtasd has started (for example starting the VM in paused state, or hotplug during FW or boot loader)

Re: [PATCH v2] Linux VM workaround for Knights Landing A/D leak

2016-06-15 Thread Nadav Amit
Dave Hansen wrote: > On 06/15/2016 01:04 PM, Nadav Amit wrote: >> Be careful here. According to the SDM when invalidating a huge-page, >> each 4KB page needs to be invalidated separately. In practice, when >> Linux invalidates 2MB/1GB pages it performs a full TLB flush. The >> full flush may not

Re: [PATCH 2/4] scripts: add reqs python library

2016-06-15 Thread Luis R. Rodriguez
On Wed, Jun 15, 2016 at 09:11:45PM +0200, Michal Marek wrote: > Dne 15.6.2016 v 18:02 Luis R. Rodriguez napsal(a): > > On Wed, Jun 15, 2016 at 09:50:11AM +0200, Michal Marek wrote: > >> On 2016-06-15 00:10, Luis R. Rodriguez wrote: > >>> +weight = (int(rel_specs['VERSION'])<< 32) + \ >

Re: [PATCH 1/6] staging: i4l: icn: do not use return as a function

2016-06-15 Thread Luis de Bethencourt
On 11/06/16 22:10, Sudip Mukherjee wrote: > return is not a function so no need to use the parenthesis. > > Signed-off-by: Sudip Mukherjee > --- > drivers/staging/i4l/icn/icn.c | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > All the patches in this series look like g

[PATCH] nl80211: improve nl80211_parse_mesh_config type checking

2016-06-15 Thread Arnd Bergmann
When building a kernel with W=1, the nl80211.c file causes a number of warnings, all about the same problem: net/wireless/nl80211.c: In function 'nl80211_parse_mesh_config': net/wireless/nl80211.c:5287:103: error: comparison is always false due to limited range of data type [-Werror=type-limits]

[PATCH] net: sfc: avoid -Wtype-limits warning

2016-06-15 Thread Arnd Bergmann
When building with -Wextra, we get a harmless warning from the EFX_EXTRACT_OWORD32 macro: ethernet/sfc/farch.c: In function 'efx_farch_test_registers': ethernet/sfc/farch.c:119:30: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] ethernet/sfc/farch.c:124:144: err

Re: [PATCH 2/4] scripts: add reqs python library

2016-06-15 Thread Julia Lawall
On Wed, 15 Jun 2016, Luis R. Rodriguez wrote: > On Wed, Jun 15, 2016 at 09:11:45PM +0200, Michal Marek wrote: > > Dne 15.6.2016 v 18:02 Luis R. Rodriguez napsal(a): > > > On Wed, Jun 15, 2016 at 09:50:11AM +0200, Michal Marek wrote: > > >> On 2016-06-15 00:10, Luis R. Rodriguez wrote: > > >>> +

Re: [PATCH v5 2/3] drm/arm: Add support for Mali Display Processors

2016-06-15 Thread Daniel Vetter
On Wed, Jun 15, 2016 at 10:05 PM, Russell King - ARM Linux wrote: > On Wed, Jun 15, 2016 at 09:29:38PM +0200, Daniel Vetter wrote: >> On Wed, Jun 15, 2016 at 7:21 PM, Liviu Dudau wrote: >> > Could be the tda998x_drv fault, but I'm getting this splat: >> >> Yeah, tda9998x needs to be fixed to _not

Re: [PATCH 3/3] drivers/media/media-device: fix double free bug in _unregister()

2016-06-15 Thread Shuah Khan
On 06/15/2016 02:15 PM, Max Kellermann wrote: > While removing all interfaces in media_device_unregister(), all > media_interface pointers are freed. This is illegal and results in > double kfree() if any media_interface is still linked at this point; > maybe because a userspace process still has

Re: [PATCH v3 0/4] Introduce the latent_entropy gcc plugin

2016-06-15 Thread Emese Revfy
On Wed, 15 Jun 2016 11:55:44 -0700 Kees Cook wrote: > The limit on the length of lines is 80 columns and this is a strongly > preferred limit. I think the code looks worse when it is truncated to 80 columns but I'll do it and resend the patches. -- Emese

Re: [PATCH] of: fix memory leak related to safe_name()

2016-06-15 Thread Frank Rowand
On 06/15/16 12:12, Rob Herring wrote: > On Wed, Jun 15, 2016 at 1:13 PM, Frank Rowand wrote: >> From: Frank Rowand >> >> Fix a memory leak resulting from memory allocation in safe_name(). >> This patch fixes all call sites of safe_name(). >> >> Mathieu Malaterre reported the memory leak on boot:

[PATCH] staging/rtlwifi: use s8 instead of char

2016-06-15 Thread Arnd Bergmann
Compiling the rtlwifi drivers for ARM with gcc -Wextra warns about lots of incorrect code that results from 'char' being unsigned here, e.g. staging/rtl8192e/rtl8192e/r8192E_phy.c:1072:36: error: comparison is always false due to limited range of data type [-Werror=type-limits] staging/rtl8192e/r

[PATCH v2] writeback: inode cgroup wb switch should not call ihold()

2016-06-15 Thread Tahsin Erdogan
Asynchronous wb switching of inodes takes an additional ref count on an inode to make sure inode remains valid until switchover is completed. However, anyone calling ihold() must already have a ref count on inode, but in this case inode->i_count may already be zero: [ cut here ]--

Re: [PATCH 3/3] drivers/media/media-device: fix double free bug in _unregister()

2016-06-15 Thread Max Kellermann
On 2016/06/15 22:32, Shuah Khan wrote: > This change introduces memory leaks, since drivers are relying on > media_device_unregister() to free interfaces. This is what I thought, too, until I checked the code paths. Who adds entries to that list? Only media_gobj_create() does, and only when typ

[GIT PULL] UBI fixes for 4.7-rc4

2016-06-15 Thread Richard Weinberger
Linus, The following changes since commit db06d759d6cf903aeda8c107fd3abd366dd80200: Merge branch 'for-4.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu (2016-06-13 19:54:46 -1000) are available in the git repository at: git://git.infradead.org/linux-ubifs.git tags/upst

[PATCH 1/2] scsi: lpfc: avoid harmless comparison warning

2016-06-15 Thread Arnd Bergmann
When building with -Wextra, we get a lot of warnings for the lpfc driver concerning expressions that are always true, starting with: drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_enable_npiv_init': drivers/scsi/lpfc/lpfc_attr.c:2786:77: error: comparison of unsigned expression >= 0 is always t

[PATCH v2] of: fix memory leak related to safe_name()

2016-06-15 Thread Frank Rowand
From: Frank Rowand Fix a memory leak resulting from memory allocation in safe_name(). This patch fixes all call sites of safe_name(). Mathieu Malaterre reported the memory leak on boot: On my PowerMac device-tree would generate a duplicate name: [0.023043] device-tree: Duplicate name in Po

Re: stack validation warning on lttng-modules bytecode interpreter

2016-06-15 Thread Mathieu Desnoyers
- On Jun 15, 2016, at 4:28 PM, Josh Poimboeuf jpoim...@redhat.com wrote: > On Wed, Jun 15, 2016 at 03:24:52PM -0500, Josh Poimboeuf wrote: >> Thanks, figured it out. It was an objtool bug. It was expecting the >> macro to create a section symbol (STT_SECTION), but for some reason this >> fil

Re: [PATCH v3 2/4] Add the latent_entropy gcc plugin

2016-06-15 Thread Emese Revfy
On Wed, 15 Jun 2016 11:07:08 -0700 Kees Cook wrote: > On Tue, Jun 14, 2016 at 3:20 PM, Emese Revfy wrote: > This doesn't look right to me: these are CFLAGS_REMOVE_* entries, and > I think you want to _add_ the DISABLE_LATENT_ENTROPY_PLUGIN to the > CFLAGS here. Thanks for the report. I think

<    3   4   5   6   7   8   9   10   11   12   >