android_kernel_motorola_sm6225/mm/page_io.c

415 lines
10 KiB
C
Raw Permalink Normal View History

License cleanup: add SPDX GPL-2.0 license identifier to files with no license Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 15:07:57 +01:00
// SPDX-License-Identifier: GPL-2.0
/*
* linux/mm/page_io.c
*
* Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
*
* Swap reorganised 29.12.95,
* Asynchronous swapping added 30.12.95. Stephen Tweedie
* Removed race in async swapping. 14.4.1996. Bruno Haible
* Add swap of shared pages through the page cache. 20.2.1998. Stephen Tweedie
* Always use brw_page, life becomes simpler. 12 May 1998 Eric Biederman
*/
#include <linux/mm.h>
#include <linux/kernel_stat.h>
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 09:04:11 +01:00
#include <linux/gfp.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/bio.h>
#include <linux/swapops.h>
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
#include <linux/buffer_head.h>
#include <linux/writeback.h>
mm: frontswap: core swap subsystem hooks and headers This patch, 2of4, contains the changes to the core swap subsystem. This includes: (1) makes available core swap data structures (swap_lock, swap_list and swap_info) that are needed by frontswap.c but we don't need to expose them to the dozens of files that include swap.h so we create a new swapfile.h just to extern-ify these and modify their declarations to non-static (2) adds frontswap-related elements to swap_info_struct. Frontswap_map points to vzalloc'ed one-bit-per-swap-page metadata that indicates whether the swap page is in frontswap or in the device and frontswap_pages counts how many pages are in frontswap. (3) adds hooks in the swap subsystem and extends try_to_unuse so that frontswap_shrink can do a "partial swapoff". Note that a failed frontswap_map allocation is safe... failure is noted by lack of "FS" in the subsequent printk. --- [v14: rebase to 3.4-rc2] [v10: no change] [v9: akpm@linux-foundation.org: mark some statics __read_mostly] [v9: akpm@linux-foundation.org: add clarifying comments] [v9: akpm@linux-foundation.org: no need to loop repeating try_to_unuse] [v9: error27@gmail.com: remove superfluous check for NULL] [v8: rebase to 3.0-rc4] [v8: kamezawa.hiroyu@jp.fujitsu.com: change counter to atomic_t to avoid races] [v8: kamezawa.hiroyu@jp.fujitsu.com: comment to clarify informational counters] [v7: rebase to 3.0-rc3] [v7: JBeulich@novell.com: add new swap struct elements only if config'd] [v6: rebase to 3.0-rc1] [v6: lliubbo@gmail.com: fix null pointer deref if vzalloc fails] [v6: konrad.wilk@oracl.com: various checks and code clarifications/comments] [v5: no change from v4] [v4: rebase to 2.6.39] Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Reviewed-by: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Jan Beulich <JBeulich@novell.com> Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Hugh Dickins <hughd@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Chris Mason <chris.mason@oracle.com> Cc: Rik Riel <riel@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> [v11: Rebased, fixed mm/swapfile.c context change] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-04-10 01:08:06 +02:00
#include <linux/frontswap.h>
mm: remove compressed copy from zram in-memory Swap subsystem does lazy swap slot free with expecting the page would be swapped out again so we can avoid unnecessary write. But the problem in in-memory swap(ex, zram) is that it consumes memory space until vm_swap_full(ie, used half of all of swap device) condition meet. It could be bad if we use multiple swap device, small in-memory swap and big storage swap or in-memory swap alone. This patch makes swap subsystem free swap slot as soon as swap-read is completed and make the swapcache page dirty so the page should be written out the swap device to reclaim it. It means we never lose it. I tested this patch with kernel compile workload. 1. before compile time : 9882.42 zram max wasted space by fragmentation: 13471881 byte memory space consumed by zram: 174227456 byte the number of slot free notify: 206684 2. after compile time : 9653.90 zram max wasted space by fragmentation: 11805932 byte memory space consumed by zram: 154001408 byte the number of slot free notify: 426972 [akpm@linux-foundation.org: tweak comment text] [artem.savkov@gmail.com: fix BUG due to non-swapcache pages in end_swap_bio_read()] [akpm@linux-foundation.org: invert unlikely() test, augment comment, 80-col cleanup] Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Artem Savkov <artem.savkov@gmail.com> Cc: Hugh Dickins <hughd@google.com> Cc: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Konrad Rzeszutek Wilk <konrad@darnok.org> Cc: Shaohua Li <shli@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-04 00:01:24 +02:00
#include <linux/blkdev.h>
#include <linux/psi.h>
#include <linux/uio.h>
mm/page_io.c: fix oops during block io poll in swapin path When a thread is OOM-killed during swap_readpage() operation, an oops occurs because end_swap_bio_read() is calling wake_up_process() based on an assumption that the thread which called swap_readpage() is still alive. Out of memory: Kill process 525 (polkitd) score 0 or sacrifice child Killed process 525 (polkitd) total-vm:528128kB, anon-rss:0kB, file-rss:4kB, shmem-rss:0kB oom_reaper: reaped process 525 (polkitd), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC Modules linked in: nf_conntrack_netbios_ns nf_conntrack_broadcast ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter coretemp ppdev pcspkr vmw_balloon sg shpchp vmw_vmci parport_pc parport i2c_piix4 ip_tables xfs libcrc32c sd_mod sr_mod cdrom ata_generic pata_acpi vmwgfx ahci libahci drm_kms_helper ata_piix syscopyarea sysfillrect sysimgblt fb_sys_fops mptspi scsi_transport_spi ttm e1000 mptscsih drm mptbase i2c_core libata serio_raw CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.13.0-rc2-next-20170725 #129 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 task: ffffffffb7c16500 task.stack: ffffffffb7c00000 RIP: 0010:__lock_acquire+0x151/0x12f0 Call Trace: <IRQ> lock_acquire+0x59/0x80 _raw_spin_lock_irqsave+0x3b/0x4f try_to_wake_up+0x3b/0x410 wake_up_process+0x10/0x20 end_swap_bio_read+0x6f/0xf0 bio_endio+0x92/0xb0 blk_update_request+0x88/0x270 scsi_end_request+0x32/0x1c0 scsi_io_completion+0x209/0x680 scsi_finish_command+0xd4/0x120 scsi_softirq_done+0x120/0x140 __blk_mq_complete_request_remote+0xe/0x10 flush_smp_call_function_queue+0x51/0x120 generic_smp_call_function_single_interrupt+0xe/0x20 smp_trace_call_function_single_interrupt+0x22/0x30 smp_call_function_single_interrupt+0x9/0x10 call_function_single_interrupt+0xa7/0xb0 </IRQ> RIP: 0010:native_safe_halt+0x6/0x10 default_idle+0xe/0x20 arch_cpu_idle+0xa/0x10 default_idle_call+0x1e/0x30 do_idle+0x187/0x200 cpu_startup_entry+0x6e/0x70 rest_init+0xd0/0xe0 start_kernel+0x456/0x477 x86_64_start_reservations+0x24/0x26 x86_64_start_kernel+0xf7/0x11a secondary_startup_64+0xa5/0xa5 Code: c3 49 81 3f 20 9e 0b b8 41 bc 00 00 00 00 44 0f 45 e2 83 fe 01 0f 87 62 ff ff ff 89 f0 49 8b 44 c7 08 48 85 c0 0f 84 52 ff ff ff <f0> ff 80 98 01 00 00 8b 3d 5a 49 c4 01 45 8b b3 18 0c 00 00 85 RIP: __lock_acquire+0x151/0x12f0 RSP: ffffa01f39e03c50 ---[ end trace 6c441db499169b1e ]--- Kernel panic - not syncing: Fatal exception in interrupt Kernel Offset: 0x36000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) ---[ end Kernel panic - not syncing: Fatal exception in interrupt Fix it by holding a reference to the thread. [akpm@linux-foundation.org: add comment] Fixes: 23955622ff8d231b ("swap: add block io poll in swapin path") Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reviewed-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-08-02 22:32:09 +02:00
#include <linux/sched/task.h>
#include <asm/pgtable.h>
static struct bio *get_swap_bio(gfp_t gfp_flags,
struct page *page, bio_end_io_t end_io)
{
int i, nr = hpage_nr_pages(page);
struct bio *bio;
bio = bio_alloc(gfp_flags, nr);
if (bio) {
struct block_device *bdev;
bio->bi_iter.bi_sector = map_swap_page(page, &bdev);
bio_set_dev(bio, bdev);
bio->bi_end_io = end_io;
for (i = 0; i < nr; i++)
bio_add_page(bio, page + i, PAGE_SIZE, 0);
VM_BUG_ON(bio->bi_iter.bi_size != PAGE_SIZE * nr);
}
return bio;
}
void end_swap_bio_write(struct bio *bio)
{
struct page *page = bio_first_page_all(bio);
if (bio->bi_status) {
SetPageError(page);
/*
* We failed to write the page out to swap-space.
* Re-dirty the page in order to avoid it being reclaimed.
* Also print a dire warning that things will go BAD (tm)
* very quickly.
*
* Also clear PG_reclaim to avoid rotate_reclaimable_page()
*/
set_page_dirty(page);
pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n",
MAJOR(bio_dev(bio)),
MINOR(bio_dev(bio)),
(unsigned long long)bio->bi_iter.bi_sector);
ClearPageReclaim(page);
}
end_page_writeback(page);
bio_put(bio);
}
/* Moto lulei1: check sync_io state on swap entry */
bool swap_slot_has_sync_io(swp_entry_t entry)
{
struct swap_info_struct *sis;
struct gendisk *disk;
sis = swp_swap_info(entry);
disk = sis->bdev->bd_disk;
if (disk->fops->ioctl) {
return disk->fops->ioctl(sis->bdev, 0,
SWP_SYNCHRONOUS_IO, swp_offset(entry)) == 1;
}
return (sis->flags & SWP_SYNCHRONOUS_IO) == SWP_SYNCHRONOUS_IO;
}
static void end_swap_bio_read(struct bio *bio)
{
struct page *page = bio_first_page_all(bio);
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
struct task_struct *waiter = bio->bi_private;
if (bio->bi_status) {
SetPageError(page);
ClearPageUptodate(page);
pr_alert("Read-error on swap-device (%u:%u:%llu)\n",
MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)),
(unsigned long long)bio->bi_iter.bi_sector);
mm: remove compressed copy from zram in-memory Swap subsystem does lazy swap slot free with expecting the page would be swapped out again so we can avoid unnecessary write. But the problem in in-memory swap(ex, zram) is that it consumes memory space until vm_swap_full(ie, used half of all of swap device) condition meet. It could be bad if we use multiple swap device, small in-memory swap and big storage swap or in-memory swap alone. This patch makes swap subsystem free swap slot as soon as swap-read is completed and make the swapcache page dirty so the page should be written out the swap device to reclaim it. It means we never lose it. I tested this patch with kernel compile workload. 1. before compile time : 9882.42 zram max wasted space by fragmentation: 13471881 byte memory space consumed by zram: 174227456 byte the number of slot free notify: 206684 2. after compile time : 9653.90 zram max wasted space by fragmentation: 11805932 byte memory space consumed by zram: 154001408 byte the number of slot free notify: 426972 [akpm@linux-foundation.org: tweak comment text] [artem.savkov@gmail.com: fix BUG due to non-swapcache pages in end_swap_bio_read()] [akpm@linux-foundation.org: invert unlikely() test, augment comment, 80-col cleanup] Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Artem Savkov <artem.savkov@gmail.com> Cc: Hugh Dickins <hughd@google.com> Cc: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Konrad Rzeszutek Wilk <konrad@darnok.org> Cc: Shaohua Li <shli@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-04 00:01:24 +02:00
goto out;
}
mm: remove compressed copy from zram in-memory Swap subsystem does lazy swap slot free with expecting the page would be swapped out again so we can avoid unnecessary write. But the problem in in-memory swap(ex, zram) is that it consumes memory space until vm_swap_full(ie, used half of all of swap device) condition meet. It could be bad if we use multiple swap device, small in-memory swap and big storage swap or in-memory swap alone. This patch makes swap subsystem free swap slot as soon as swap-read is completed and make the swapcache page dirty so the page should be written out the swap device to reclaim it. It means we never lose it. I tested this patch with kernel compile workload. 1. before compile time : 9882.42 zram max wasted space by fragmentation: 13471881 byte memory space consumed by zram: 174227456 byte the number of slot free notify: 206684 2. after compile time : 9653.90 zram max wasted space by fragmentation: 11805932 byte memory space consumed by zram: 154001408 byte the number of slot free notify: 426972 [akpm@linux-foundation.org: tweak comment text] [artem.savkov@gmail.com: fix BUG due to non-swapcache pages in end_swap_bio_read()] [akpm@linux-foundation.org: invert unlikely() test, augment comment, 80-col cleanup] Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Artem Savkov <artem.savkov@gmail.com> Cc: Hugh Dickins <hughd@google.com> Cc: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Konrad Rzeszutek Wilk <konrad@darnok.org> Cc: Shaohua Li <shli@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-04 00:01:24 +02:00
SetPageUptodate(page);
out:
unlock_page(page);
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
WRITE_ONCE(bio->bi_private, NULL);
bio_put(bio);
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
wake_up_process(waiter);
mm/page_io.c: fix oops during block io poll in swapin path When a thread is OOM-killed during swap_readpage() operation, an oops occurs because end_swap_bio_read() is calling wake_up_process() based on an assumption that the thread which called swap_readpage() is still alive. Out of memory: Kill process 525 (polkitd) score 0 or sacrifice child Killed process 525 (polkitd) total-vm:528128kB, anon-rss:0kB, file-rss:4kB, shmem-rss:0kB oom_reaper: reaped process 525 (polkitd), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC Modules linked in: nf_conntrack_netbios_ns nf_conntrack_broadcast ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter coretemp ppdev pcspkr vmw_balloon sg shpchp vmw_vmci parport_pc parport i2c_piix4 ip_tables xfs libcrc32c sd_mod sr_mod cdrom ata_generic pata_acpi vmwgfx ahci libahci drm_kms_helper ata_piix syscopyarea sysfillrect sysimgblt fb_sys_fops mptspi scsi_transport_spi ttm e1000 mptscsih drm mptbase i2c_core libata serio_raw CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.13.0-rc2-next-20170725 #129 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 task: ffffffffb7c16500 task.stack: ffffffffb7c00000 RIP: 0010:__lock_acquire+0x151/0x12f0 Call Trace: <IRQ> lock_acquire+0x59/0x80 _raw_spin_lock_irqsave+0x3b/0x4f try_to_wake_up+0x3b/0x410 wake_up_process+0x10/0x20 end_swap_bio_read+0x6f/0xf0 bio_endio+0x92/0xb0 blk_update_request+0x88/0x270 scsi_end_request+0x32/0x1c0 scsi_io_completion+0x209/0x680 scsi_finish_command+0xd4/0x120 scsi_softirq_done+0x120/0x140 __blk_mq_complete_request_remote+0xe/0x10 flush_smp_call_function_queue+0x51/0x120 generic_smp_call_function_single_interrupt+0xe/0x20 smp_trace_call_function_single_interrupt+0x22/0x30 smp_call_function_single_interrupt+0x9/0x10 call_function_single_interrupt+0xa7/0xb0 </IRQ> RIP: 0010:native_safe_halt+0x6/0x10 default_idle+0xe/0x20 arch_cpu_idle+0xa/0x10 default_idle_call+0x1e/0x30 do_idle+0x187/0x200 cpu_startup_entry+0x6e/0x70 rest_init+0xd0/0xe0 start_kernel+0x456/0x477 x86_64_start_reservations+0x24/0x26 x86_64_start_kernel+0xf7/0x11a secondary_startup_64+0xa5/0xa5 Code: c3 49 81 3f 20 9e 0b b8 41 bc 00 00 00 00 44 0f 45 e2 83 fe 01 0f 87 62 ff ff ff 89 f0 49 8b 44 c7 08 48 85 c0 0f 84 52 ff ff ff <f0> ff 80 98 01 00 00 8b 3d 5a 49 c4 01 45 8b b3 18 0c 00 00 85 RIP: __lock_acquire+0x151/0x12f0 RSP: ffffa01f39e03c50 ---[ end trace 6c441db499169b1e ]--- Kernel panic - not syncing: Fatal exception in interrupt Kernel Offset: 0x36000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) ---[ end Kernel panic - not syncing: Fatal exception in interrupt Fix it by holding a reference to the thread. [akpm@linux-foundation.org: add comment] Fixes: 23955622ff8d231b ("swap: add block io poll in swapin path") Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reviewed-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-08-02 22:32:09 +02:00
put_task_struct(waiter);
}
int generic_swapfile_activate(struct swap_info_struct *sis,
struct file *swap_file,
sector_t *span)
{
struct address_space *mapping = swap_file->f_mapping;
struct inode *inode = mapping->host;
unsigned blocks_per_page;
unsigned long page_no;
unsigned blkbits;
sector_t probe_block;
sector_t last_block;
sector_t lowest_block = -1;
sector_t highest_block = 0;
int nr_extents = 0;
int ret;
blkbits = inode->i_blkbits;
blocks_per_page = PAGE_SIZE >> blkbits;
/*
* Map all the blocks into the extent list. This code doesn't try
* to be very smart.
*/
probe_block = 0;
page_no = 0;
last_block = i_size_read(inode) >> blkbits;
while ((probe_block + blocks_per_page) <= last_block &&
page_no < sis->max) {
unsigned block_in_page;
sector_t first_block;
cond_resched();
first_block = bmap(inode, probe_block);
if (first_block == 0)
goto bad_bmap;
/*
* It must be PAGE_SIZE aligned on-disk
*/
if (first_block & (blocks_per_page - 1)) {
probe_block++;
goto reprobe;
}
for (block_in_page = 1; block_in_page < blocks_per_page;
block_in_page++) {
sector_t block;
block = bmap(inode, probe_block + block_in_page);
if (block == 0)
goto bad_bmap;
if (block != first_block + block_in_page) {
/* Discontiguity */
probe_block++;
goto reprobe;
}
}
first_block >>= (PAGE_SHIFT - blkbits);
if (page_no) { /* exclude the header page */
if (first_block < lowest_block)
lowest_block = first_block;
if (first_block > highest_block)
highest_block = first_block;
}
/*
* We found a PAGE_SIZE-length, PAGE_SIZE-aligned run of blocks
*/
ret = add_swap_extent(sis, page_no, 1, first_block);
if (ret < 0)
goto out;
nr_extents += ret;
page_no++;
probe_block += blocks_per_page;
reprobe:
continue;
}
ret = nr_extents;
*span = 1 + highest_block - lowest_block;
if (page_no == 0)
page_no = 1; /* force Empty message */
sis->max = page_no;
sis->pages = page_no - 1;
sis->highest_bit = page_no - 1;
out:
return ret;
bad_bmap:
pr_err("swapon: swapfile has holes\n");
ret = -EINVAL;
goto out;
}
/*
* We may have stale swap cache pages in memory: notice
* them here and get rid of the unnecessary final write.
*/
int swap_writepage(struct page *page, struct writeback_control *wbc)
{
int ret = 0;
mm: try_to_free_swap replaces remove_exclusive_swap_page remove_exclusive_swap_page(): its problem is in living up to its name. It doesn't matter if someone else has a reference to the page (raised page_count); it doesn't matter if the page is mapped into userspace (raised page_mapcount - though that hints it may be worth keeping the swap): all that matters is that there be no more references to the swap (and no writeback in progress). swapoff (try_to_unuse) has been removing pages from swapcache for years, with no concern for page count or page mapcount, and we used to have a comment in lookup_swap_cache() recognizing that: if you go for a page of swapcache, you'll get the right page, but it could have been removed from swapcache by the time you get page lock. So, give up asking for exclusivity: get rid of remove_exclusive_swap_page(), and remove_exclusive_swap_page_ref() and remove_exclusive_swap_page_count() which were spawned for the recent LRU work: replace them by the simpler try_to_free_swap() which just checks page_swapcount(). Similarly, remove the page_count limitation from free_swap_and_count(), but assume that it's worth holding on to the swap if page is mapped and swap nowhere near full. Add a vm_swap_full() test in free_swap_cache()? It would be consistent, but I think we probably have enough for now. Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: Rik van Riel <riel@redhat.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Robin Holt <holt@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 23:39:36 +01:00
if (try_to_free_swap(page)) {
unlock_page(page);
goto out;
}
if (frontswap_store(page) == 0) {
mm: frontswap: core swap subsystem hooks and headers This patch, 2of4, contains the changes to the core swap subsystem. This includes: (1) makes available core swap data structures (swap_lock, swap_list and swap_info) that are needed by frontswap.c but we don't need to expose them to the dozens of files that include swap.h so we create a new swapfile.h just to extern-ify these and modify their declarations to non-static (2) adds frontswap-related elements to swap_info_struct. Frontswap_map points to vzalloc'ed one-bit-per-swap-page metadata that indicates whether the swap page is in frontswap or in the device and frontswap_pages counts how many pages are in frontswap. (3) adds hooks in the swap subsystem and extends try_to_unuse so that frontswap_shrink can do a "partial swapoff". Note that a failed frontswap_map allocation is safe... failure is noted by lack of "FS" in the subsequent printk. --- [v14: rebase to 3.4-rc2] [v10: no change] [v9: akpm@linux-foundation.org: mark some statics __read_mostly] [v9: akpm@linux-foundation.org: add clarifying comments] [v9: akpm@linux-foundation.org: no need to loop repeating try_to_unuse] [v9: error27@gmail.com: remove superfluous check for NULL] [v8: rebase to 3.0-rc4] [v8: kamezawa.hiroyu@jp.fujitsu.com: change counter to atomic_t to avoid races] [v8: kamezawa.hiroyu@jp.fujitsu.com: comment to clarify informational counters] [v7: rebase to 3.0-rc3] [v7: JBeulich@novell.com: add new swap struct elements only if config'd] [v6: rebase to 3.0-rc1] [v6: lliubbo@gmail.com: fix null pointer deref if vzalloc fails] [v6: konrad.wilk@oracl.com: various checks and code clarifications/comments] [v5: no change from v4] [v4: rebase to 2.6.39] Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Reviewed-by: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Jan Beulich <JBeulich@novell.com> Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Hugh Dickins <hughd@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Chris Mason <chris.mason@oracle.com> Cc: Rik Riel <riel@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> [v11: Rebased, fixed mm/swapfile.c context change] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-04-10 01:08:06 +02:00
set_page_writeback(page);
unlock_page(page);
end_page_writeback(page);
goto out;
}
ret = __swap_writepage(page, wbc, end_swap_bio_write);
out:
return ret;
}
static inline void count_swpout_vm_event(struct page *page)
{
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
if (unlikely(PageTransHuge(page)))
count_vm_event(THP_SWPOUT);
#endif
count_vm_events(PSWPOUT, hpage_nr_pages(page));
}
int __swap_writepage(struct page *page, struct writeback_control *wbc,
bio_end_io_t end_write_func)
{
struct bio *bio;
int ret;
struct swap_info_struct *sis = page_swap_info(page);
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
VM_BUG_ON_PAGE(!PageSwapCache(page), page);
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
if (sis->flags & SWP_FILE) {
struct kiocb kiocb;
struct file *swap_file = sis->swap_file;
struct address_space *mapping = swap_file->f_mapping;
struct bio_vec bv = {
.bv_page = page,
.bv_len = PAGE_SIZE,
.bv_offset = 0
};
struct iov_iter from;
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
iov_iter_bvec(&from, ITER_BVEC | WRITE, &bv, 1, PAGE_SIZE);
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
init_sync_kiocb(&kiocb, swap_file);
kiocb.ki_pos = page_file_offset(page);
mm: swap: mark swap pages writeback before queueing for direct IO As pointed out by Andrew Morton, the swap-over-NFS writeback is not setting PageWriteback before it is queued for direct IO. While swap pages do not participate in BDI or process dirty accounting and the IO is synchronous, the writeback bit is still required and not setting it in this case was an oversight. swapoff depends on the page writeback to synchronoise all pending writes on a swap page before it is reused. Swapcache freeing and reuse depend on checking the PageWriteback under lock to ensure the page is safe to reuse. Direct IO handlers and the direct IO handler for NFS do not deal with PageWriteback as they are synchronous writes. In the case of NFS, it schedules pages (or a page in the case of swap) for IO and then waits synchronously for IO to complete in nfs_direct_write(). It is recognised that this is a slowdown from normal swap handling which is asynchronous and uses a completion handler. Shoving PageWriteback handling down into direct IO handlers looks like a bad fit to handle the swap case although it may have to be dealt with some day if swap is converted to use direct IO in general and bmap is finally done away with. At that point it will be necessary to refit asynchronous direct IO with completion handlers onto the swap subsystem. As swapcache currently depends on PageWriteback to protect against races, this patch sets PageWriteback under the page lock before queueing it for direct IO. It is cleared when the direct IO handler returns. IO errors are treated similarly to the direct-to-bio case except PageError is not set as in the case of swap-over-NFS, it is likely to be a transient error. It was asked what prevents such a page being reclaimed in parallel. With this patch applied, such a page will now be skipped (most of the time) or blocked until the writeback completes. Reclaim checks PageWriteback under the page lock before calling try_to_free_swap and the page lock should prevent the page being requeued for IO before it is freed. This and Jerome's related patch should considered for -stable as far back as 3.6 when swap-over-NFS was introduced. [akpm@linux-foundation.org: use pr_err_ratelimited()] [akpm@linux-foundation.org: remove hopefully-unneeded cast in printk] Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: <stable@vger.kernel.org> [3.6+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-30 00:08:48 +02:00
set_page_writeback(page);
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
unlock_page(page);
ret = mapping->a_ops->direct_IO(&kiocb, &from);
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
if (ret == PAGE_SIZE) {
count_vm_event(PSWPOUT);
ret = 0;
} else {
mm: swap: mark swap pages writeback before queueing for direct IO As pointed out by Andrew Morton, the swap-over-NFS writeback is not setting PageWriteback before it is queued for direct IO. While swap pages do not participate in BDI or process dirty accounting and the IO is synchronous, the writeback bit is still required and not setting it in this case was an oversight. swapoff depends on the page writeback to synchronoise all pending writes on a swap page before it is reused. Swapcache freeing and reuse depend on checking the PageWriteback under lock to ensure the page is safe to reuse. Direct IO handlers and the direct IO handler for NFS do not deal with PageWriteback as they are synchronous writes. In the case of NFS, it schedules pages (or a page in the case of swap) for IO and then waits synchronously for IO to complete in nfs_direct_write(). It is recognised that this is a slowdown from normal swap handling which is asynchronous and uses a completion handler. Shoving PageWriteback handling down into direct IO handlers looks like a bad fit to handle the swap case although it may have to be dealt with some day if swap is converted to use direct IO in general and bmap is finally done away with. At that point it will be necessary to refit asynchronous direct IO with completion handlers onto the swap subsystem. As swapcache currently depends on PageWriteback to protect against races, this patch sets PageWriteback under the page lock before queueing it for direct IO. It is cleared when the direct IO handler returns. IO errors are treated similarly to the direct-to-bio case except PageError is not set as in the case of swap-over-NFS, it is likely to be a transient error. It was asked what prevents such a page being reclaimed in parallel. With this patch applied, such a page will now be skipped (most of the time) or blocked until the writeback completes. Reclaim checks PageWriteback under the page lock before calling try_to_free_swap and the page lock should prevent the page being requeued for IO before it is freed. This and Jerome's related patch should considered for -stable as far back as 3.6 when swap-over-NFS was introduced. [akpm@linux-foundation.org: use pr_err_ratelimited()] [akpm@linux-foundation.org: remove hopefully-unneeded cast in printk] Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: <stable@vger.kernel.org> [3.6+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-30 00:08:48 +02:00
/*
* In the case of swap-over-nfs, this can be a
* temporary failure if the system has limited
* memory for allocating transmit buffers.
* Mark the page dirty and avoid
* rotate_reclaimable_page but rate-limit the
* messages but do not flag PageError like
* the normal direct-to-bio case as it could
* be temporary.
*/
set_page_dirty(page);
mm: swap: mark swap pages writeback before queueing for direct IO As pointed out by Andrew Morton, the swap-over-NFS writeback is not setting PageWriteback before it is queued for direct IO. While swap pages do not participate in BDI or process dirty accounting and the IO is synchronous, the writeback bit is still required and not setting it in this case was an oversight. swapoff depends on the page writeback to synchronoise all pending writes on a swap page before it is reused. Swapcache freeing and reuse depend on checking the PageWriteback under lock to ensure the page is safe to reuse. Direct IO handlers and the direct IO handler for NFS do not deal with PageWriteback as they are synchronous writes. In the case of NFS, it schedules pages (or a page in the case of swap) for IO and then waits synchronously for IO to complete in nfs_direct_write(). It is recognised that this is a slowdown from normal swap handling which is asynchronous and uses a completion handler. Shoving PageWriteback handling down into direct IO handlers looks like a bad fit to handle the swap case although it may have to be dealt with some day if swap is converted to use direct IO in general and bmap is finally done away with. At that point it will be necessary to refit asynchronous direct IO with completion handlers onto the swap subsystem. As swapcache currently depends on PageWriteback to protect against races, this patch sets PageWriteback under the page lock before queueing it for direct IO. It is cleared when the direct IO handler returns. IO errors are treated similarly to the direct-to-bio case except PageError is not set as in the case of swap-over-NFS, it is likely to be a transient error. It was asked what prevents such a page being reclaimed in parallel. With this patch applied, such a page will now be skipped (most of the time) or blocked until the writeback completes. Reclaim checks PageWriteback under the page lock before calling try_to_free_swap and the page lock should prevent the page being requeued for IO before it is freed. This and Jerome's related patch should considered for -stable as far back as 3.6 when swap-over-NFS was introduced. [akpm@linux-foundation.org: use pr_err_ratelimited()] [akpm@linux-foundation.org: remove hopefully-unneeded cast in printk] Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: <stable@vger.kernel.org> [3.6+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-30 00:08:48 +02:00
ClearPageReclaim(page);
pr_err_ratelimited("Write error on dio swapfile (%llu)\n",
page_file_offset(page));
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
}
mm: swap: mark swap pages writeback before queueing for direct IO As pointed out by Andrew Morton, the swap-over-NFS writeback is not setting PageWriteback before it is queued for direct IO. While swap pages do not participate in BDI or process dirty accounting and the IO is synchronous, the writeback bit is still required and not setting it in this case was an oversight. swapoff depends on the page writeback to synchronoise all pending writes on a swap page before it is reused. Swapcache freeing and reuse depend on checking the PageWriteback under lock to ensure the page is safe to reuse. Direct IO handlers and the direct IO handler for NFS do not deal with PageWriteback as they are synchronous writes. In the case of NFS, it schedules pages (or a page in the case of swap) for IO and then waits synchronously for IO to complete in nfs_direct_write(). It is recognised that this is a slowdown from normal swap handling which is asynchronous and uses a completion handler. Shoving PageWriteback handling down into direct IO handlers looks like a bad fit to handle the swap case although it may have to be dealt with some day if swap is converted to use direct IO in general and bmap is finally done away with. At that point it will be necessary to refit asynchronous direct IO with completion handlers onto the swap subsystem. As swapcache currently depends on PageWriteback to protect against races, this patch sets PageWriteback under the page lock before queueing it for direct IO. It is cleared when the direct IO handler returns. IO errors are treated similarly to the direct-to-bio case except PageError is not set as in the case of swap-over-NFS, it is likely to be a transient error. It was asked what prevents such a page being reclaimed in parallel. With this patch applied, such a page will now be skipped (most of the time) or blocked until the writeback completes. Reclaim checks PageWriteback under the page lock before calling try_to_free_swap and the page lock should prevent the page being requeued for IO before it is freed. This and Jerome's related patch should considered for -stable as far back as 3.6 when swap-over-NFS was introduced. [akpm@linux-foundation.org: use pr_err_ratelimited()] [akpm@linux-foundation.org: remove hopefully-unneeded cast in printk] Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: <stable@vger.kernel.org> [3.6+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-30 00:08:48 +02:00
end_page_writeback(page);
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
return ret;
}
ret = bdev_write_page(sis->bdev, map_swap_page(page, &sis->bdev),
page, wbc);
if (!ret) {
count_swpout_vm_event(page);
return 0;
}
ret = 0;
bio = get_swap_bio(GFP_NOIO, page, end_write_func);
if (bio == NULL) {
set_page_dirty(page);
unlock_page(page);
ret = -ENOMEM;
goto out;
}
bio->bi_opf = REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc);
bio_associate_blkcg_from_page(bio, page);
count_swpout_vm_event(page);
set_page_writeback(page);
unlock_page(page);
submit_bio(bio);
out:
return ret;
}
int swap_readpage(struct page *page, bool synchronous)
{
struct bio *bio;
int ret = 0;
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
struct swap_info_struct *sis = page_swap_info(page);
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
blk_qc_t qc;
struct gendisk *disk;
unsigned long pflags;
swp_entry_t entry;
VM_BUG_ON_PAGE(!PageSwapCache(page) && !synchronous, page);
VM_BUG_ON_PAGE(!PageLocked(page), page);
VM_BUG_ON_PAGE(PageUptodate(page), page);
/*
* Count submission time as memory stall. When the device is congested,
* or the submitting cgroup IO-throttled, submission can be a
* significant part of overall IO time.
*/
psi_memstall_enter(&pflags);
if (frontswap_load(page) == 0) {
mm: frontswap: core swap subsystem hooks and headers This patch, 2of4, contains the changes to the core swap subsystem. This includes: (1) makes available core swap data structures (swap_lock, swap_list and swap_info) that are needed by frontswap.c but we don't need to expose them to the dozens of files that include swap.h so we create a new swapfile.h just to extern-ify these and modify their declarations to non-static (2) adds frontswap-related elements to swap_info_struct. Frontswap_map points to vzalloc'ed one-bit-per-swap-page metadata that indicates whether the swap page is in frontswap or in the device and frontswap_pages counts how many pages are in frontswap. (3) adds hooks in the swap subsystem and extends try_to_unuse so that frontswap_shrink can do a "partial swapoff". Note that a failed frontswap_map allocation is safe... failure is noted by lack of "FS" in the subsequent printk. --- [v14: rebase to 3.4-rc2] [v10: no change] [v9: akpm@linux-foundation.org: mark some statics __read_mostly] [v9: akpm@linux-foundation.org: add clarifying comments] [v9: akpm@linux-foundation.org: no need to loop repeating try_to_unuse] [v9: error27@gmail.com: remove superfluous check for NULL] [v8: rebase to 3.0-rc4] [v8: kamezawa.hiroyu@jp.fujitsu.com: change counter to atomic_t to avoid races] [v8: kamezawa.hiroyu@jp.fujitsu.com: comment to clarify informational counters] [v7: rebase to 3.0-rc3] [v7: JBeulich@novell.com: add new swap struct elements only if config'd] [v6: rebase to 3.0-rc1] [v6: lliubbo@gmail.com: fix null pointer deref if vzalloc fails] [v6: konrad.wilk@oracl.com: various checks and code clarifications/comments] [v5: no change from v4] [v4: rebase to 2.6.39] Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Reviewed-by: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Jan Beulich <JBeulich@novell.com> Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Hugh Dickins <hughd@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Chris Mason <chris.mason@oracle.com> Cc: Rik Riel <riel@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> [v11: Rebased, fixed mm/swapfile.c context change] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-04-10 01:08:06 +02:00
SetPageUptodate(page);
unlock_page(page);
goto out;
}
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
if (sis->flags & SWP_FILE) {
struct file *swap_file = sis->swap_file;
struct address_space *mapping = swap_file->f_mapping;
ret = mapping->a_ops->readpage(swap_file, page);
if (!ret)
count_vm_event(PSWPIN);
goto out;
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
}
/* Moto lulei1: Use rw_page for zram page but submit_bio for zram wb page.
* Since reading zram wb page is an async operation, we can not immediately
* free the slot here. So we need to read the page via submit_bio and free
* the slot in end_swap_bio_read. (bio chain will be used to handle bio here
* and bio in zram driver for wb page).
*/
entry.val = page_private(page);
if (swap_slot_has_sync_io(entry)) {
Merge tag 'MMI-S2SE32.28-28-4' of https://github.com/MotorolaMobilityLLC/kernel-msm into lineage-20 hawao push for android 12 * tag 'MMI-S2SE32.28-28-4' of https://github.com/MotorolaMobilityLLC/kernel-msm: (4348 commits) Hawaii+ OLED: sim1+sim2+sd fast plugGing cause phone hang kernel/config: hawao: usb: sim1+sim2+sd fast plugGing cause phone hang shmem becomes bigger and bigger when launch apps driver/power: Add debug logs Hawao: Fix NFC power consumption in sleep mode. devon:charger bring up lib/iov_iter: initialize "flags" in new pipe_buffer BACKPORT: dmabuf: fix use-after-free of dmabuf's file->f_inode kernel:add bc12 detect channel definition Revert "(CR): drm: mipi: Disable the MIPI DSI commands 0x2E and 0x3E" devon4g: camera flash bringup sctp: add param size validation for SCTP_PARAM_SET_PRIMARY sctp: validate chunk size in __rcv_asconf_lookup sctp: add size validation when walking chunks sctp: validate from_addr_param return aio: fix use-after-free due to missing POLLFREE handling aio: keep poll requests on waitqueue until completed signalfd: use wake_up_pollfree() binder: use wake_up_pollfree() wait: add wake_up_pollfree() FROMGIT: binder: fix test regression due to sender_euid change UPSTREAM: binder: use cred instead of task for getsecid BACKPORT: binder: use cred instead of task for selinux checks UPSTREAM: binder: use euid from cred instead of using task arm64/defconfig: add devon extra configs USB: gadget: bRequestType is a bitfield, not a enum USB: gadget: zero allocate endpoint 0 buffers USB: gadget: detect too-big endpoint 0 requests hawao: devconfig: enable CHACHA20 crypto configs rhode: devconfig: enable CHACHA20 crypto configs regulator: Force shutdown all regulators when system power off. arm64: defconfig: Flash compatible TZ: Distinguishes encrypted and unencrypted TZ logs interfaces. TZ: Fix build err Hawaii+OLED:remove CONFIG_QCOM_FSA4480_I2C defconfig: Disable SLAB_MERGE. arm64/config:Enable Zram writeback on hawao Enable LZ4 on Rhode4G and Hawao dts: rhode: remove CONFIG_QCOM_FSA4480_I2C mm: zram: fix build error when zram wb disabled mm : zram fix swapcached issue on Zram Writeback fs:proc:abort reclaim once process goes to foreground ip_gre: add validation for csum_start arm64/config:Enable Zram writeback on Rhode kernel:add charger termination definition rhode:kernel: add wt6670 get firmware num node kernel/config:hawao:remove FTS TP config to use module kernel/input:hawao:update to use TP module ko kernel: remove wt6670 isp macro definition for user version kernel/config:hawao: add new FTS config to fix build error input/touchscreen: add ft3519 source config input/ft3519: hawao touch driver bringup Revert "(CR) hawaii OLED: visionox ft3519 touch drvier bringup" kernel: add wt6670 macro definition to control i2c nack QC3P:add iio channel definition Rhode: define CONFIG_CAMERA_FLASH_PWM display: Modify LDO driver initialization voltage compatibility Hawao: NFC Bringup(4) - driver hawaii OLED: visionox ft3519 touch drvier bringup kernel: qc3p wt6760 isp download function kernel:add ADC_GPIO3_DIV3 adc channel display/config: Add LDO driver config into the kernel. display: Load the regulator driver directly into the kernel. kernel: use orderly_poweroff when usb plugged out tty:diag:Move tty_flip_buffer_push out of spinlock Revert "tty:revert the tty update from qcom for moto tty_diag driver" kernel:dwc3 delay extcon module registeration ANDROID: xt_quota2: set usersize in xt_match registration object ANDROID: xt_quota2: clear quota2_log message before sending ANDROID: xt_quota2: remove trailing junk which might have a digit in it arm/defconfig: add hawao extra config usb:diag:revert the f_diag update from qcom for moto tty_diag driver tty:revert the tty update from qcom for moto tty_diag driver Enable samsung NFC driver integrate samsung RN4V NFC driver Rhode4G: wide camera bring up kernel: add charger gki kernel: change spi gpio for i2c gpio for charger Remove gpio3 from reserve list for rhode4g arm/defconfig: add rhode extra config [PATCH] f2fs: flush data when enabling checkpoint back [PATCH] f2fs: flush data when enabling checkpoint back Revert "(CR) guamp: emmc add ffu" Removing debug config [PATCH] qseecom: Call INIT_WORK() before flush_work() guamp: emmc add ffu Caprip: modify the actuator noise reduction work flow. Caprip: modify the actuator noise reduction work flow. APP data lost after first R upgrade Porting of (CR) replace WARN with pr_debug for IPA api (CR) Make NCM driver compatible with windows disable CONFIG_SLUB_DEBUG for user builds disable CONFIG_DEBUG_PANIC_ON_OOM in userdebug builds Include inlinecrypt at config.gz to fix Q->R upgrade usb: add xhci-hw-lpm-disable dt property support kernel:ram overwritten by TZ logs to cause random panics Caprip: Add start/stop vibrating notification to actuator. arm64: defconfig: Actuator noise reduction. kernel: driver/vibrator: diff vol for long/short vib skip ipa assert for debug build (patch 2) skip ipa assert for debug build limit ion cache size Revert "(CR) power: Add wakeup source in battery historian logGing" power: print active wakeup source before suspend. alarmtimer: add debug to identify alarmtimers charger:driver:fix non power off issue for factory kill. arm64/defconfig: Capri: open nfc driver for Capri arm64/defconfig: disable debug fs on user build charger:support typec high 2A current at non-turbo product arm/defconfig: enable CONFIG_DEBUG_LIST on R soc: qcom: service-locator: enlarge timeout value arm/defconfig: Caprip: init kernel deconfig arm/defconfig: Capri: init kernel deconfig Revert "Revert "msm: media: uapi: Redefine NV12 format with different alignment"" Revert "msm: media: uapi: Redefine NV12 format with different alignment" clear SDAM for new battery profile loading. disable DEBUG_PANIC_ON_OOM on 3G ram device driver:qg:enale QG_DEBUG_SOC. Charge: fix slab out of bounds risk charge: qc2.0 adapter charge slow charge: Handle QC2.0 charger vbus rise 12V BCL: Enable charge bcl feature arm: setup: support mem= memory limit arm: call idle notifiers in CPU idle charger:improve micro-b input current to 1.9A per HW Capri bring up kernel:distinguish type-c and microb cdp input setting disable SPLIT_RSS_COUNTING to fix zero RSS issue charger:add battery test mode support for cebu. spi: disable_depth > 0 when pm runtime get sync driver/spi: spi driver suspend changes kernel: panel_notifier: Add new panel notify event type mmc:host:sdhci:Fix host->claimer NULL pointer problem Change ION fill mark from 100M to 16M to reduce the Lost RAM arm/defconfig: cebu: init kernel deconfig NFC VEN pin startup and shutdown sequence disable watermark boost charge:Config DCP 2A charge current tune memory configs charger:limit typec high to medium when hvdcp disabled charger:support 2A dcp charger arm64/defconfig: enable external usb camera power: reset: Use warm reset for dload mode Update kernel config of userdebug on Guam/GuamP to improve performance charger:duplicated apsd detection at pmi632 expose ssr_reason to ss_ramdump SD: print SD interrupt log charger:SW_ICL do not used at moto charger:factory image charGing soc over 75% usb audio: Let the usb sound card index from 1 kernel:USB DRP connect debug accessory test charge: config: config batt NTC for bornr NA Kernel: add sys node for panel supplier gpu/drm: Create panelRegDA sysfs to expose panel's reg pwrkey: change printk level to output to console Reboot: trigger warm reset when receive hw_warmreset cmd disable CONFIG_DEBUG_CONSOLE_UNHASHED_POINTERS for sts test Revert (CR): power: smb5: Clear HDC AICL arm/defconfig: borneo: init kernel deconfig guam serials: remove kernel config for PASR Revert "mm, vmstat: hide /proc/pagetypeinfo from normal users" arm/defconfig: guam: init kernel deconfig arm/defconfig: add 32bit debug config defconfig.mk: add arch specific debug enable psi for guam guamp Revert "defconfig: disable MEMCG for bengal 32" Fix QC rebase issue for dual role sysfs access issue ion: display ion total size in debufs node ion: dmabuf improve debugfs kernel:support huawei p10 5A cable bengal:Enable dual role usb interface smb5:Add dual role class support in smb5 usb:Add dual role class support sdcardfs: don't depend on reserved_mb to check free space sdcardfs: check the free space before creating files sdcardfs: copy inode size while getting attributes remove nfc function for guam charger:allow APSD re-run at factory usb detection CONFIG_FPR_FPC disable for rebase fingerprint fix defconfig.mk: Don't force make defconfig gitignore: ignore dts link guamp: arm64/dtsi enable regulator_fixed_voltage power: Add wakeup source in battery historian logGing arm64/defconfig: enable softlockup panic for debug arm64/defconfig : enable NFC kernel:add OCP charger current limitation guam: add touch module support Revert "(CR): config: disable CONFIG_PANIC_ON_REFCOUNT_ERROR" arm64/defconfig: disable debug config config: disable CONFIG_PANIC_ON_REFCOUNT_ERROR arm64/configs: sm4250: Enable USB console tty: msm_geni_serial: Support the match() callback printk: Keep boot console on if enabled arm64/config: support UAS of usb storage arm64/defconfig: enable usbnet drivers usb:configfs:Set udc_name NULL if attach failed usb/dwc3: msm: Enable all Debug Logs gadget: bcdUSB version back to 2.0 when not SuperSpeed usb: configfs: synchronize the secure and udc_name state usb: configfs: skip unregister gadget in secure usb: gadget: f_mtp: Return error if count is negative usb: gadget: storage: Support READ_TOC for MacOS usb: configfs: Implement secure attribute usb: configfs: Reset the use_os_desc flag usb: mass_storage: Add support for SC_REBOOT usb: f_mtp: Handle OS descriptors only when bound config:remove unused smb1355 config guam: input add touch class support arm64/config: enable DIAG_OVER_TTY drivers: tty: add tty diag module char: diag: add write done sync function panel_notify: add api for touch state guam: defconfig: enable panel notifications video: Add panel_notifier framework drm: mipi: disable Elvss dim of HBM for MIPI DSI Add new macro MIPI_DSI_MSG_READ gpu/drm: Create sysfs to expose panel vendor infor drm: mipi: Disable the MIPI DSI commands 0x2E and 0x3E drm/dsi: Implement DCS set disp brightness 2bytes guam: input add drm support defconfig: bengal: enable pstore power: Add function to show active wakelocks power: suspend: Save snapshot of gpio, vreg when suspend PM/Suspend: Print wall time at suspend entry and exit - Do not unload prov TZ app. add system restart warm and panic mode printk: increase log buffer size to 2k qpnp-power-on: Print system timestamp on Power key event regulator: core: Add sysfs node for debug pinctrl: msm: Add sysfs node for debug watchdog_v2: export watchdog trigger pinctrl: pinctrl-msm: do not dump unallocated GPIOs of: conditional status property arm64/dt add kpanic modules kernel:moto charger/battery driver enable config:battery 10k ntc enable guamp: input add touch support input add touch support kernel:JK50 NTC 10K report wrong temp arm/defconfig: update debug option defconfig: enable CONFIG_MEMCG config defconfig: bengal: Add moto defconfigs msm-poweroff: Store restart reason power: pmic-voter: Export Interfaces Do not build moto config while building MSI kernel/config: Add Moto ext_config feature soc: qcom: kconfig opt to build moto dtbs msm: kgsl: Zap performance counters across context switches msm: kgsl: Add a sysfs node to control performance counter reads soc: qcom: socinfo: Add soc information for KhajeP and KhajeQ spi: spi-msm-geni: Put device to suspend if PM status is active cnss2: Handle event processing after shutdown cfg80211: Add support to advertize OCV support i2c: i2c-msm-v2: Set frequency parameters to INT and validate drivers: thermal: validate cdev sysfs state request before using it USB: f_fs: Fix disconnect check during ongoing IO msm: diag: fix copyright diag: Validate the dci client before sending dci packet drivers: soc: qcom: Initialize blocking notifier as per lockdep usb: gadget: u_audio: fix race condition on endpoint stop usb: gadget: u_audio: Free requests only after callback defconfig: Enable usb peripheral audio on SXR2130 msm: ADSPRPC: Fix to avoid Use after free in fastrpc_init_process clk: qcom: vdd-level: Update the vdd level for CX on Khaje msm: ipa3: Fix to validate the NAT table entries during NAT table init msm: synx: fix copyright clk: qcom: gpucc: Update the vdd level for CX on Khaje diag: Ensure dci entry is valid before sending the packet usb: pd: Process request message as soon as it is received mmc: sdhci-msm: Update the MGPI SW check to avoid irq timeout msm: kgsl: Perform cache flush on the pages obtained using get_user_pages() dfc: reset tx queue clk: qcom: gpucc: Add support for higher frequency for Khaje msm: ipa3: fix to cleanup the dma allocation clk: qcom: vdd-level: Update the VDD levels for Bengal/Khaje include: qcom,rpm-smd-regulator.h: Add SUPER_TURBO corner usb: gadget: qdss: Don't clear debug_inface_enabled upon unbind msm: adsprpc: Handle UAF in fastrpc debugfs read usb: gadget: f_hid: Fix unbind issues usb: gadget: f_uvc: Fix unbind issues msm: synx: remove synx handle details from logging clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI mmc: sdhci-msm: Ensure SD card power isn't ON when card removed msm: kgsl: Fix gpuaddr_in_range() to check upper bound clk: qcom: clk-alpha-pll: Update the steps to slew the Lucid PLL spi: spi-msm-geni: Protect from register access in suspend state spi: spi-msm-geni: Keep device to suspend if PM call fails regulator: qcom_pm8008-regulator: Avoid deadlock in OCP handling usb: gadget: f_uac1: Add support for UAC1 function tzlog: update struct to get normal and fatal diag logs firmware: qcom: Remove garbage characters from qsee log firmware: qcom: add enlarged qsee log support firmware: qcom: encrypted tz and qsee log support input: misc: qcom-power-on: Add support to log KPDPWR status tzlog: update struct to get normal and fatal diag logs firmware: qcom: Remove garbage characters from qsee log firmware: qcom: add enlarged qsee log support firmware: qcom: encrypted tz and qsee log support fs: crypto: Maintain reference count for class keys usb: pd: always log when state machine work is queued leds: qti-tri-led: remove LED_KEEP_TRIGGER flag usb: pd: add usbpd_dbg() in pd_send_msg() diag: Update log and event mask code ranges usb: gadget: Clear string index for RMNET drivers: usb: enable SET_REPORT through EP0 feature clk: qcom: debugcc: Remove gcc_pcnoc_mpu_cfg_ahb_clk for QM215 clk: qcom: debugcc: Remove im_sleep/xo_div4 for QM215 af_unix: fix garbage collect vs MSG_PEEK net: split out functions related to registering inflight socket files uapi: sound: add bt external sink delay parameter mhi: core: Increase RDDM timeout to 350ms msm: npu: remove asynchronous network execution support usb: max-3421: Prevent corruption of freed memory mmc: host: Add recovery_finish crypto vops seq_file: disallow extremely large seq buffer allocations dfc: hold wakelock while powersave timer is running diag: Avoid possible out of bound access while sending masks diag: Sanitize non-hdlc pkt length against buffer capacity diag: Allow DCI packets to be copied separately msm: gsi: Stop Channel support when in Flow Control State msm: kgsl: Signal fence only if last fence refcount was not put media: v4l2: Allow ioctl type of "U" for video devices like usb camera msm: adsprpc: Handle UAF in process shell memory cnss2: Check if firmware asserts before power off for CBC usb: gadget: cdev: Add single packet and dynamic buffer support for Rx path net: qrtr: Use radix_tree_iter_delete to delete tx flow ipa: Null persistent pointers after free net: qrtr: Cleanup flow control during DEL proc qdss_bridge: handle usb write done event net: qrtr: Cleanup flow control during remote socket release leds: qpnp-flash-v2: Add support for dynamic torch current update thermal: Update copyright info for ADC_TM driver net: qrtr: Converting DEL_PROC command to BYE command defconfig: Enable SPMI TEMP ALARM driver for SPF targets msm: ipa3: Fix to NULL terminate the header pointer in proc header table usb: dwc3: Prevent deadlock when wakeup happens through pwr event irq thermal: Read raw values for ADC_TM calibration channels qdss_bridge: fix stuck issue when driver remove media: uvcvideo: Use cached memory for USB transfers defconfig: Enable Novatek NT36xxx Touch for tron target cnss2: Dump PCIE SOC scratch registers along with mhi reg dumps ANDROID: mm: use raw seqcount variants in vm_write_* msm: kgsl: Update the IFPC power up reglist msm: ipa3: Add wait queue for the adpl msm: ipa3: Fix to unlock mutex before return cnss2: Update bound checks for sbl reg dumps to SRAM mem range cnss2: Fix the pbl log sram start address for QCA6490 defconfig: arm: msm: 8937-Turn on coresight configs arm: msm: Add support for coresight etr for 32 bit soc: qcom: memory_dump: Support ETB/ETR register dump defconfig: arm64: msm: 8937-Turn on coresight configs drivers: thermal: Update a variable type in QMI encode logic BACKPORT: dma-buf: Move dma_buf_release() from fops to dentry_ops power: smb1398-charger: Toggle UVLO for Slave CP on USB removal msm: npu: handle system shutdown/reboot event properly dma-mapping-fast: Fix iova address leak with non-zero scatterlist offset net: qrtr: Change error logging in callback defconfig: Enable PMIC related configs for MSM8937_32 defconfig: Enable PMIC related configs for MSM8937_64 defconfig: Enable Charger/LED/RTC configs for MSM8937_32go power: linear-charger: Report the correct battery status at SOC=0 power: charger/fg: Add charger/fg/bms drivers for QM215 defconfig: Enable ADC thermal and SPMI configs for SPF targets thermal: Modify qpnp_adc_tm driver for IIO framework thermal: qpnp-adc: Add snapshot of qpnp-adc-tm driver msm: ipa3: Queue nop desc again if it fails diag: Drop packets to avoid memory exhaustion msm-ipa: fix use-after-free of rt_tbl net: qualcomm: rmnet: enable support for cksumv3 serial: msm_geni_serial: Avoid port pointer access for earlyconsole case rpmsg: glink: Change error logging to avoid throttling USB: gadget: f_uvc: Enable more controls for CT and PU serial: msm_geni_serial: Reduce stale delay added in stop_rx_sequencer msm: kgsl: Add timeline traces msm: kgsl: Add software timelines serial: msm_geni_serial: Reduce stale delay added in stop_rx_sequencer usb: f_mtp: Limit MTP Tx req length to 16k for ChipIdea fuse: give wakeup hints to the scheduler wait: add wake_up_sync() msm: ipa: Fix to free up all pending EOB pages msm: kgsl: Add the user API definition for timelines Add support for new HSP version usb: dwc3: dwc3-msm: optimize perf vote work i2c: i2c-qcom-geni: Change the high and low time for SCL net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() tty: Fix ->session locking msm: ipa3: increasing the uC interrupt timeout value msm: kgsl: Fix out of bound write in adreno_profile_submit_time diag: Update log and event mask code ranges soc: qcom: Set QOS only to silver cluster dwc3-msm: Move override usb speed functionality outside edev check cnss2: Update board data file name for certain RF chip ID platform: qpnp-revid: Add REVID support for PM8010 regulator: qcom_pm8008-regulator: add support for PMIC PM8010 regulator: qcom_pm8008: allow multiple PM8008 instances with unique names block: pm: Fix possible unbalanced nr_pending usb: f_mtp: Don't handle OS descriptors from MTP driver power: supply: qpnp-smb5: specify different ICL for QC2 9V/12V level phy: msm: usb: Check VBUS state before accessing registers in suspend phy: msm: usb: Fail suspend if psy_type is USB or USB_CDP USB: phy: msm: Apply DP pulse for CDP during bootup from sm_work msm: adsprpc: Allocate buffer taking NULL byte into consideration clk: qcom: debugcc: Remove the gcc_camss_camnoc clocks fbdev: msm: Avoid runtime sus/res for DP/HDMI uapi: Add UAPI headers for slatecom_interface driver soc: qcom: smsm: Add wakeup capable flags to SMSM IRQ f2fs: don't sleep while grabing nat_tree_lock Ignore -106 error while opening channel byte-cntr: Don't write csr register when byte-cntr is disabled arm64: defconfig: Set qrtr wakeup for lito net: qrtr: Make wakeup timeout configurable mhi: core: Avoid race condition mhi channel prepare and M0 event msm: synx: acquire ref of synx handle in each function msm: ipa3: Fix to handle zero length frag skb packet cnss_utils: Update the copyright years of file to 2017, 2019-2021 FM: mutex changes modified Revert "qseecom: Add shmbrdige to allocate memory" Revert "ANDROID: net: ipv4: sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size" Revert "RFC: ANDROID: net: ipv4: sysfs_net_ipv4: Fix TCP window size controlling knobs" ANDROID: xt_qtaguid: fix UAF race coresight: byte-cntr: Add ETR status check in bypass notifier clk: qcom: debugcc: Remove the gcc_camss_camnoc clocks usb: f_fs: Avoid invalid pointer access in ffs_fs_get_tree serial: msm_geni_serial: Enable SW flow on in runtime suspend defconfig: msm: Enable RPM SMD cooling device driver for KHAJE defconfig: Enable CONFIG_ION_SYSTEM_HEAP for bengal f2fs: fix the periodic wakeups of discard thread f2fs: allow to change discard policy based on cached discard cmds coresight: byte-cnter: limit error log output coresight: byte-cnter: Add ETR status check in bypass notifier msm: synx: fix synx_release_core race condition irqchip: mpm: Add mpm mapping for Khaje f2fs: change to use rwsem for cp_mutex cnss2: Assert on FW memory allocation failure msm: kgsl: Keep the context alive until its fences signal soc: qcom: secure_buffer: Fix the parameter passing to dmac_flush_range cnss_utils: Increase unsafe channel max num for 6G clk: qcom: gpucc: Update voltage fmax table for GPU clock for KHAJE msm: ipa3: Enable hardbyte limit for WAN consumer pipe dma-mapping-fast: Fix sg-list length calculation in fast_smmu_unmap_sg() qseecom: Add shmbrdige to allocate memory msm: kgsl: Use worker to put refcount on mem entry usb: phy: qusb: Add wrapper function for phy reset usb: pd: Clear vdm_tx if SVDM message is sent on SOP' drivers: thermal: virtual-sensor: Add new virtual sensor for MSM8917 defconfig: Enable CONFIG_ION_SYSTEM_HEAP for bengal futex: Handle faults correctly for PI futexes f2fs: fix the periodic wakeups of discard thread f2fs: allow to change discard policy based on cached discard cmds futex: Simplify fixup_pi_state_owner() futex: Provide and use pi_state_update_owner() usb: phy: Reset PHY while disabling dpdm regulator futex: Replace pointless printk in fixup_owner() soc: qcom: smem: Update size of legacy partition USB: diag: Add check for ctxt in usb_diag_request_size() driver: Fix compilation error with new sdclang 12 msm: ipa3: Changes to check disconnect in progress while sending data msm: adsprpc: Protect maps using map mutex USB: f_diag: Report Max request size as 16k for ChipIdea defconfig: Enable thermal emergency poweroff delay mmc: sdhci-msm: Switch to required pad voltage for vbias bypass mmc: sdhci-msm: Add vbias bypass specific hw WA flag Revert "mmc: sdhci-msm: Add support to vote for vdd io parent regulator" defconfig: kona: Add CONFIG_AQFWD for RB5 board clk: qcom: gpucc-khaje: Remove NOM_L1 fmax corner mmc: sdhci: Avoid dumping registers when SD card removed FM: Fix for no sound issue in FM Audio usb: gadget: Do not disconnect unregistered dev HID: add HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE for Gamevice devices defconfig: kona: Make configs required to pass CTS tests mandatory UPSTREAM: HID: playstation: Add DualSense player LED support UPSTREAM: HID: playstation: Add microphone mute support for DualSense UPSTREAM: HID: playstation: Add initial DualSense lightbar support UPSTREAM: HID: playstation: Fix unused variable in ps_battery_get_property UPSTREAM: HID: playstation: Fix array size comparison (off-by-one) BACKPORT: HID: playstation: Report DualSense hardware and firmware version UPSTREAM: HID: playstation: Add DualSense accelerometer and gyroscope BACKPORT: HID: playstation: Add DualSense classic rumble support msm: adsprpc: Lock list before removing node msm: pcie: Add ASM2806 PCIe device and vendor id TREAM: HID: playstation: Track devices in list UPSTREAM: HID: playstation: Add DualSense touchpad support UPSTREAM: HID: playstation: Add DualSense battery support UPSTREAM: HID: playstation: Add DualSense Bluetooth support UPSTREAM: HID: playstation: Use DualSense MAC address as unique identifier defconfig: arm64: msm: Enable CTI_SAVE_DISABLE for SDM660 UPSTREAM: HID: playstation: Initial DualSense USB support defconfig: Enable smb1394 driver for khaje coresight-tmc-etr: remove mem_lock when call usb_qdss_close soc: qcom: socinfo: Add support for kona iot soc-id defconfig: sdm660: Add defconfig changes for camera usb: f_qdss: Flush connect_work in qdss close clk: qcom: gpucc: Update the post div ops for GPUCC PLL for KHAJE clk: qcom: clk-alpha-pll: Update implementation for Zonda PLL coresight: tmc: fix spinlock bad magic/usb_qdss_close scsi: ufs-qcom: fix the issue of get wrong ufs clk status from sysfs node futex: Ensure the correct return value from futex_lock_pi() defconfig: arm: msm: Enable debugcc config for SDM439 dt-bindings: Add gpr header required for AR on kona clk: qcom: gpucc: Update the post div ops for GPUCC PLL for KHAJE clk: qcom: clk-alpha-pll: Update implementation for Zonda PLL drivers: thermal: Add support for RPM SMD cooling device diag: Avoid reallocating if buffer supports hdlc max pkt size mhi: core: Fix find_last_bit() usage diag: Update log and event mask code ranges drivers: rpmh: Always bug_on() upon timeout in rpmh_write_batch() clk: qcom: mdss: Fix flicker issue at early boot of kernel drivers: can: mcp25xxfd: Remove return 0 for void function Revert "kbuild: force to build vmlinux if CONFIG_MODVERSION=y" msm: ipa3: Enabling the HOLB on USB consumer pipe for APQ target soc: qcom: dcc: Avoid dcc_sram_writel overflow qxr-stdalonevwr: changes for oracle mic bias soc: qcom: dcc: Avoid huge memory allcation defconfig: msm8937_64: Update the defconfigs soc: qcom: dcc: Use sscanf instead of strlcpy power: qpnp-qg: Fix a DT property name mmc: host: OTA upgrade scenario support for multi fs combination drivers: cpuidle: lpm-levels: Correct missing list initialize serial: msm_geni_serial: Reset UART error code to default during shutdown serial: msm_geni_serial: Add Workqueue to dump the registers cnss2: Add code to do PCIe L2 suspend during shutdown pinctrl: Update reserved gpio list for Khaje config: enable dcc driver soc: qcom: dcc: Add snapshot of qcom-dcc driver serial: msm_geni_serial: Bailout from suspend if RX data is pending diag: Update log and event mask code ranges usb: f_fs: Free descriptors in func_unbind clk: qcom: alpha-pll: Update Alpha PLL width for Zonda PLL usb: gadget: f_rndis: Add 'wceis' flag to indicate 'Wireless' RNDIS clk: qcom: khaje: Update clock changes for GCC/GPUCC/DISPCC clk: qcom: cpu: Add support to L2 PC latency for SDM429/39 clk: qcom: cpu-sdm: Add cpu clock driver for SDM439 dt-bindings: clock: Add support for CPUCC clock ids for SDM439 clk: qcom: Add LPM Latency support for CPU clocks clk: qcom: clk-pll: Add support for SPM event in PLL serial: msm_geni_serial: Reduce wait for transfer delay usb: f_fs: Avoid use-after-free of ffs_data include: uapi: Add support for 128x32 alignment of NV12 defconfig: Enable refgen regulator driver for khaje clk: qcom: rcg2: Force enable the RCG before update for GFX mhi: core: Notify all mhi client's for PCIe link down recovery power: smblite: Fix max_limit_ma for smblite msm: ipa3: Fix to prevent Integer Overflow dcc_v2: Control the cti trigger of each link list individually msm: kgsl: Fix memory leak for anonymous buffers defconfig: Enable remaining defconfigs clk: qcom: debugcc: Add cpucc debugcc support for SDM439 clk: qcom: gcc: Correct the frequencies in freq_tbl for SDM439 clk: qcom: gcc: Add GPLL6 fixed factor support for qm215 cnss2: Add code to notify mhi about link down defconfig: disable per-cgroup pressure tracking defconfig: arm64: msm: Enable MSM_DEBUG_LAR_UNLOCK for msm8937 defconfig: arm: msm: Enable MSM_DEBUG_LAR_UNLOCK for msm8937 soc: mem_dump: Enable MSM_DEBUG_LAR_UNLOCK for MSM8937 defconfig: sdm660: Add missing coresight configs From bbfaa7d36c1eb465f120f2a3dfe25c1fe022195d Mon Sep 17 00:00:00 2001 From: KaiChieh Chuang <kaichieh.chuang@mediatek.com> Date: Thu, 7 Mar 2019 07:51:09 +0800 Subject: [PATCH] ASoC: dpcm: prevent snd_soc_dpcm use after free soc: qcom: Return correct error code when program_key fails fails msm: ADSPRPC: Fix deadlock during SSR soc: qcom: bam_dmux: Skip disconnect call on bootup usb: dwc3: Use pwr_evt_irq to wakeup if dp/dm directly connected to GIC BACKPORT: cgroup: make per-cgroup pressure stall tracking configurable usb: dwc3-msm: Enable pwr_evt_irq for wakeup after LPM is done power: qpnp-qg: Add support to clear soh upon first profile load msm: kgsl: Make sure gpu-speed-bin-vectors has the correct size msm: kgsl: Add multiple fuses based speed bin Change the subprocess argument to fix the build issue include: uapi: Add QBG UAPI headers defconfig: Enable AW2016 LED driver for khaje clk: qcom: gcc: Add halt check for MSS clocks for SDM660 msm: adsprpc: Handle UAF in process shell memory msm: camera: Add gpio based flash driver support leds: aw2016: update breath sysfs node name Use environment variable to find unifdef tool kernel_headers: Explicitly run headers_install under 'sh' dt-bindings: msm: Add bindings for flash type clk: qcom: mmcc: Change halt to halt_voted for SDM660 msm: kgsl: Keep private intact until last refcount is put clk: qcom: khaje: Update freq_tbl and pll configurations defconfig: Enable power delivery on Khaje coresight-tmc-etr: Fix deadlock issue while switching mode defconfig: Enable memory cgroup config leds: add initial driver for AW2016 LED device pinctrl: Update PINCTRL macro definition for Khaje input: touchscreen: nt36xxx: Add Chip id and firmware ANDROID: Incremental fs: Set credentials before reading/writing pinctrl: Add wakeup GPIO register and bit information for khaje defconfig: khaje: Enable khaje pinctrl pinctrl: msm: add range of reserved gpio for Khaje defconfig: disable debug configs ANDROID: Incremental fs: fix up attempt to copy structures with READ/WRITE_ONCE mmc: cqhci: Handle cqhci crypto configurations correctly disp: uapi: drm: Add fsc format modifier Revert "clk: qcom: Add enable_safe_config for gfx3d_clk_src" mhi: core: Prevent doorbell with invalid tre msm: adsprpc: Remove bad ioctl log pinctrl: qcom: Add support for Khaje SoC pin control dt-bindings: msm: Add bindings for flash type msm: ipa: Fix array out of bound and use after NULL check msm: ipa: Fix to check only reset IPA stats can have data as NULL msm: ipa: Fix pointer checked for NULL may be used msm: kgsl: Remove sysfs entries after releasing memory msm: kgsl: Remove debugfs directory inside lock leds: led-class: Retain the latest user brightness request leds: led-class: add support for max_brightness store mmc: core: Add at least 3 mclk cycle delay before next command after ACMD41 FM: Reduce high scan time soc: qcom: Add check to handle out of bound access defconfig: Enable CONFIG_MSM_TZ_LOG for 8937-perf HID: make arrays usage and value to be the same md: dm-default-key: Override dun value for selected bios defconfig: khaje: Add support for clock controllers clk: qcom: debugcc: Add support for Debugcc for KHAJE fbdev: msm: Avoid race condition while iommu mapping from DSI flow md: dm-default-key: Fix IV with set_dun flag defined cnss2: Log SW_CTRL GPIO value if PCIe link training fails diag: Update log and event mask code ranges camera: smmu: fix for incorrect populated sids msm: npu: Use spinlock for ipc write to avoid context switch msm: kgsl: Fix nr_removed calculation while reducing pools Avoid fatal error if ICE registers are not defined rpmsg: qcom_smd: Return error if receive callback is not present clk: qcom: dispcc: Add support for dispcc driver for KHAJE phy-msm-usb: Add mutex for protecting msm_otg_reset wil6210: Drop unicast sub frame if part of a multicast amsdu clk: qcom: gpucc: Add Graphics Clock controller for KHAJE clk: qcom: gcc-khaje: Add GCC support for KHAJE dt-bindings: clock: gcc-khaje: Add support for USB3 MUX and BCR msm: ipa3: Fix to change the tag process timeout value in cleanup usb: dt-bindings: Add USB QMP PHY registers definition for Khaje power: supply: smb1398-charger: disable WIN_OV deglitch for SMB1394 serial: msm_geni_serial: Add ioctl for sending uart error codes to BT host defconfig: Enable SDM429 configs mmc: cmdq_hci: Notify sdhci for enhanced strobe mmc: sdhci-msm: Skip PWRSAVE_DLL setting for sdcc minor verion 0x4D clk: qcom: Add enable_safe_config for gfx3d_clk_src fbdev: msm: Increment commit count during null commit msm: mdss: clear fences in ESD panel dead scenario defconfig: Add HSUSB PHY configurations to Khaje defconfig: Enable SDM429 configs diag: Add debug logs while reading masks into userspace tty: serial: msm: Add suspend resume support defconfig: Enable config CONFIG_UTS_NS for msm8937_32 f_uac2: increase number of requests to 32 for UAC2 defconfig: Enable SDM429 configs USB: dwc3: gadget: Queue data for 16 micro frames ahead in future USB: uvc: Fix video quality issues for streaming video over USB USB: dwc3: gadget: Increase TX fifo size for isochronous endpoint power: smb1398: Add support for SMB1394 clk: qcom: mdss: fix blank / un-blank issue for DSI 12nm pll msm: camera: Add reset logic for snps phy msm: ipa: Fix considering prefetch buf size when mapping usb_bam: Set default BAM type as DWC3 if not specified dt-bindings: clock: Add support for KHAJE clock ids msm: drm: uapi: add rounded corner uapi USB: gadget: f_uvc: Enable required controls for CT and PU vidc_3x: Change to avoid unloading firmware msm: camera: Update SDM439 csiphy driver ipa: Remove overwrite copy Add support for new comanche 1.3 soc ID wil6210: check integrity of received AMSDU packets wil6210: Drop plaintext frames on secure network wil6210: AP should not forward eapol packets netfilter: nf_conntrack_h323: lost .data_len definition for Q.931/ipv6 vidc_3x: Use static table governor for bus voting usb: f_qdss: Avoid wait_for_completion if qdss_disable is called msm: ipa2: free the skb defconfig: Enable ARCH_KHAJE msm: Add initial support for Khaje in Kconfig platform soc: qcom: socinfo: Add soc information for khaje defconfig: Enable config CONFIG_DEBUG_FS for msm8937_64 clk: qcom: clk-alpha-pll: Add support for FSM legacy mode sysfs: ufs-qcom: Add sysfs entries for flashpvl scsi: ufs-qcom: Add one vendor specific sysfs group msm: ipa3: Fix to copy num of rules from user space defconfig: remove CONFIG_SECURITY_PERF_EVENTS_RESTRICT msm: kgsl: Fix snapshot collection for ib1 input: qti-haptics: ensure valid pointer when calling kfree msm: kgsl: Avoid flooding kernel log with invalid ioctl errors rpmsg: qcom_smd: Add check for remote state in send api msm: kgsl: Flush mem workqueue and retry if failed to find SVM region msm: camera: Update csiphy data rate icnss2: Add support for MHI state info soc: qcom: ssr: Enable the irqs before powering up subsystems icnss2: Add new ipc context to log smp2p related logs diag: Update log and msg mask code ranges ARM: defconfig: Enable config for msm8937_32go usb: gadget: f_cdev: Fix use after free of port in f_cdev defconfig: arm64: Enable CONFIG_HID_NINTENDO for QM215 defconfig: arm: Enable CONFIG_HID_NINTENDO for QM215 defconfig: Enable config for msm8937_32 fbdev: msm: Handle rotator init failure correctly tty: Fix ->pgrp locking in tiocspgrp() max31760: add support for additional registers Revert "ANDROID: security,perf: Allow further restriction of perf_event_open" USB: composite: Increase the IN endpoint buffer allocation USB: f_fs: Avoid NULL pointer dereference during epfile_io() USB: gadget: f_fs: Allocate extra buffer for IN endpoint USB: f_serial/f_acm: Increase the IN endpoint buffer allocation USB: f_fs: Increase the IN endpoint buffer allocation leds: qpnp-flash-v2: Add support to control flash ramp time msm: vidc_3x: Correct the arguments type to align with format string msm: vidc_3x: correct the flags set for bus mode defconfig: msm8937_32: Disable BUILD_ARM64_APPENDED_DTB_IMAGE flag defconfig: msm8937_64: Disable BUILD_ARM64_APPENDED_DTB_IMAGE flag soc: qcom: pil: Reuse carveout region for mdt header clk: qcom: gcc: Change rate max values for SDM439 defconfig: msm8937_32go: Disable BUILD_ARM64_APPENDED_DTB_IMAGE flag qseecom: Update correct parameters before sending to smcinvoke msm: ADSPRPC: Add extra checks for Unsigned request msm: camera: QM215 delay during power up sequence config: enable rmnet_data, msm_rmnet_bam driver msm: kgsl: Add A504 GPU support for SDM429 defconfig: Enable MSM8937 and SDM439 config defconfig: Enable SDM439 config defconfig: Enable MSM8937 and SDM439 config defconfig: Enable default-key driver for msm8937_32 defconfig: Enable default-key driver for msm8937_64 defconfig: Add Radio_IRIS related config parameter defconfig: Add Radio_IRIS related config parameter cnss2: Add CNSS_BUS_EVENT to report bus info cnss2: Add update_uevent API to notify CNSS event rpmsg: qcom_smd: Ensure ordering of channel info updates defconfig: Enable WCNSS configs soc: qcom: bam_dmux: Abort open/close cmd during SSR diag: Use valid data_source for a valid token Add support for new HSP version mmc: sdio: Retune sdio after resume diag: Copy length and buffer locally to send to userspace client diag: Update log mask code ranges config: enable new rmnet_data driver regulator: qpnp-lcdb: Add n_voltages property for LCDB regulators spi: spi-geni-qcom: Set IOEB for MHI on SPI RX only case diag: Prevent out of bound write while sending dci pkt to remote drivers: rpmsg: fix to avoid dump stack in rpm-smd driver msm: kgsl: Enable content protection for A505 GPU serial: msm_geni_serial: Bypass Flow control lines from termios defconfig: Enable config for msm8937_64 iommu/arm-smmu: add option to enable halt/resume of SMMU config: enable new rmnet_data driver usb: gadget: Add snapshot of USB RMNET Function driver extcon: Initialize blocking notifier while registering clk: qcom: gcc: Add GCC driver node support for SDM429 icnss: Avoid qmi register/unregister in case of qmi failure icnss2: Avoid qmi register/unregister in case of qmi failure tcp: adjust rto_base in retransmits_timed_out() tcp: retry more conservatively on local congestion tcp: create a helper to model exponential backoff tcp: always set retrans_stamp on recovery tcp: address problems caused by EDT misshaps cnss2: Add sysfs support for configuring qtimer sync interval iommu/arm-smmu: Allocate non-coherent memory for secure pagetables defconfig: msm: Enable dm-snapshot for msm8937_32go defconfig: msm: Enable dm-snapshot for msm8937_32 defconfig: msm: Enable dm-snapshot for msm8937_64 clk: qcom: clk-pll: Round off req_rate in determine rate include: uapi: Add charger specific headers for QM215 clk: qcom: smd-rpm: Add RPM-SMD clock support for SDM429 defconfig: Enable USB BAM and SMD configs mhi: dev: netdev: Set the mac header to 0 for skbs msm: adsprpc: overflow vulnerability by race condition in adsprpc driver defconfig: Enable USB BAM and SMD configs defconfig: Enable default-key driver for msm8937_32go signal: Avoid corrupting si_pid and si_uid in do_notify_parent defconfig: Enable MDSS PLL for msm8937 defconfig: Initial defconfig files for MSM8937_64 ice: add return value for functions where ICE is disabled cnss2: Check for BT Enable GPIO in QCA6390 soc: qcom: Enable MSM_TZ_SMMU msm8937 usb: gadget: Setup DMA ops for OTG's gadget devices fbdev: msm: Enable mdss rotator driver defconfig: Enable MDSS PLL config for msm8937_32 defconfig: Add Radio_IRIS related config parameter cnss2: Use unified API to get RDDM and recovery timeouts cnss2: Add new API to get QMI related timeouts cnss2: Add support to populate device memory information iommu: Update function for ARM_MSM_SECURE io pagetable type Don't use gpio_free() for output gpios clk: qcom: gcc: Add gcc-mdss driver node support for QM215 RPMSG driver changes for FM in msm-4.19 defconfig: Enable USB BAM configs defconfig: Initial defconfig files for MSM8937_32 cnss2: Add CNSS wrapper function for msm_pcie_reg_dump() clk: qcom: gcc: Add GPLL3 derived frequencies for qm215 iio: spmi-vadc: Add option to specify scale-fn-type in devicetree iio: adc: spmi-vadc: Add adc support for SPF targets cfg80211: Adjust 6 GHz frequency to channel conversion iommu: Do not set COHERENT flag for secure pagetable allocation soc: qcom: smp2p: Add proper retrigger detection drivers: soc: qcom: Fix compilation errors clk: qcom: mdss: Update VCO Clk enums for mdss-dsi-28lpm dt-bindings: clock: Add mdss-28nm-pll-clk for legacy targets drivers: soc: qcom: Add bam dmux smem state handling net: ethernet: Add snapshot of RMNET BAM driver scsi: ufs: Fix IOCTL error checking for input buffer clk: qcom: mdss: fix blank / unblank for DSI 28nm pll soc: qcom: Add support for MSM_TZ_SMMU iommu/arm-smmu: Do not write to slave side protected context banks net/sched: fix race between deactivation and dequeue for NOLOCK qdisc uio: msm_sharedmem: By pass failure for hyp_assign_phys defconfig: enable PSI config for MSM8937_32go spmi: spmi-pmic-arb-debug: replace ioremap_resource with ioremap qcom-geni-se: Avoid dumping of GENI registers in console dm verity: skip verity work on I/O errors when system is shutting down Return Immediately if failed to set to reset gpio state msm: adsprpc: Clean DMA handles maps in case of error diag: Prevent possible out of bound copy to userspace ARM: decompressor: avoid speculative prefetch from protected regions power: smb5-lib: Fix race conditions for typec power role msm: mdss: update the DSI 12nm PHY programming sequence msm: mdss: update the power down sequence for DSI 12nm PHY msm: ice: Fix stack-out-of-bound erros on kasan builds clk: qcom: debugcc: Add cpucc debugcc support for QM215 msm: ipa: Fix use-after-free in ipa3_alloc_counter_id msm: ipa: correct the pointer in idr for FnR stats counter fbdev: msm: update event callback function to perform ESD check ANDROID: xt_qtaguid: Remove tag_entry from process list on untag clk: qcom: mdss: update dsi 12nm clock driver msm: ipa: fix race condition on PM vote on sys pipes msm: ipa3: Fix to null pointer access radio: iris: Add snapshot of iris FM radio support defconfig: Add WCNSS related config parameter wcnss: Update pm wake api's for 4.19 kernel qtee_shmbridge: update copyright diag: Update event and log mask code ranges arm-smmu: add bitmap for secure context banks iommu/arm-smmu: override writel_relaxed in smmu global address space qseecom: Add flush_work based on flag icnss2: Add handler for SMMU faults wcnss: Add wcnss snapshot to msm-4.19 mm: cma: Print correct request pages defconfig: Add clock controller support for QM215 clk: qcom: cpu-sdm: Add cpu clock driver for SDM dt-bindings: iio: Add scale function for QM215 batt therm platform: msm: Add USB BAM support to ChipIdea/RMNET leds: vibrator: Add snapshot of vibrator driver tty: serial: msm_geni_serial: Resolve race btw stop rx and cancel rx msm: kgsl: Access map_count only if entry is successfully allocated tty: serial: msm_geni_serial: Fix timeout for Rx abort defconfig: Enable chipidea USB controller configs msm: sde: Update rotator OT settings for sdm660 msm: mdss: dsi: set backlight handle to NULL in error case clk: qcom: mdss: Add check to read the gdsc status msm: npu: Don't send interrupt if command has been consumed msm: ipa: Send actual DL flt rule length to Q6 sde: rotator: use shared lock while accessing vbif clk: qcom: clk-pll: Add support for HF PLL Ops clk: qcom: Add enable/disable to clk_regmap_mux_div_ops clk: qcom: Update parent map to use parent_map struct qseecom: Update the error val check ARM: qcom: add board config support for sdm439 and sdm429 ARM: qcom: Add board config support for msm8937 Set the default slot for Full Disk Encryption key to 31 msm: ipa: Enable wdi3 API in ipa3 config iio: ch101: Return -ENODEV when get expander GPIO failed USB: EHCI: Add MSM Host Controller driver usb: gadget: Add snapshot of ChipIdea driver usb: phy: Add snapshot of PHY msm usb driver qdss_bridge: fix kfree issue rpmsg: glink: do not break from interrupt handler msm: kgsl: Set correct values for SMMU protect register for A3xx clk: qcom: clk-debug: Add support to dump GDSC registers usb: dwc3: gadget: Prevent double free scenario for cancelled_list diag: Enable graceful transfer of transport diag: Enable diag over rpmsg communication for adsp drivers: char: Fix compilation error for smd pkt driver defconfig: msm: Enable smd pkt driver for QM215/SDM429/439 clk: qcom: mdss: update mdss-dsi-28lpm clk names rtc: rtc-pm8xxx: add support for PM8916 RTC msm: mdss: Fix race condition while iommu mapping from DSI flow defconfig: enable MDSS PLL config for MSM8937_32go msm: ipa: fix potential race condition ioctls dt-bindings: clock: Add support for CPUCC clock ids for QM215 Add support for new versions for BT chip smcinvoke: Update the correct parameters and result from qseecom misc: add qrc ioctl functions misc: add qrc_core and qrc_uart diag: Sanitize the mempools with pool data size check socinfo: Add socinfo support for sdm450 socinfo: Add socinfo support for msm8953 ARM: qcom: Add board config support for sdm450 ARM: qcom: Add board config support for msm8953 usb: dwc3: Enable parkmode for Gen1 controllers msm: camera: Fix for HFR120 crash while msm: gsi: Using kzalloc instead of devm_kzalloc clk: qcom: debugcc: Add debugcc support for QM215 clk: qcom: gcc: Add support for GCC clock driver usb: f_diag: Replace ERROR with pr_err clk: qcom: mdss: add dsi phy 12nm clock dt-bindings: clock: Add 12nm clock device tree bindings rpmsg: qcom_smd: Add NO_SUSPEND flag for smd edge irq rpmsg: qcom_smd: Read data of size equal to fifo size rpmsg: qcom_smd: Read data of size greater than fifo size rpmsg: qcom_smd: Add ipc logging for smd driver msm: kgsl: Change start variable type to int in kgsl_iommu_add_global rpmsg: smd: Signal the TX channel that smd driver read data rpmsg: qcom_smd: Add GET/SET signal support rpmsg: qcom_smd: increase bounce buffer size drivers: rpmsg: Add smd driver module at post core init kona_defconfig: Enable hidraw config usb: misc: nb7vpq904m: update suspend and resume function msm: kgsl: Use pid struct to find the process to reclaim mm: process_reclaim: pass pid struct instead of tgid msm: kgsl: Change vma->vm_file to shmem file mm: process_reclaim: skip target_vma iio: qcom-rradc: Update logic to monitor health of RRADC peripheral cfg80211: export regulatory_hint_user() API msm: mdss: update MDSS DSI ULPS configuration fbdev: msm: call pxl clk unprepare during suspend msm: mdss: add support to handle LP_RX_TO/BTA_TO errors for DSI 12nm PHY msm: mdss: perform DSI PHY s/w reset for 12nm PHY during unblank msm: mdss: update the MDSS DSI ULPS exit sequence msm: mdss: add support to program of HSTX drivers for DSI 12nm PHY msm: mdss: update DSI ULPS entry/exit sequence msm: mdss: add support for DSI 12nm PHY in DSI driver net: qrtr: Excessive logging casuing boot failure defconfig: msm: enable thermal efuse driver for kona iot drivers: thermal: qcom: Add driver to modify thermal zone based on efuse mmc: core: Set cqe_enabled flag correctly serial: msm_geni_serial: Fix false warning for reset failure Kconfig: enable default config of cpu freq qcom for msm8953 msm: Add initial support for sdm450 Kconfig platform msm: Add initial support for msm8953 Kconfig platform Revert "cnss2: Dump mhi debug regs on receiving mhi WAKE event cb" msm: pcie: Restore BME for RC after link_down recovery on SBR msm: ADSPRPC: Substitute vfs check with flags icnss: Allow register/unregister driver execution in serial manner drivers: char: reset signal support for smd channels drivers: char: add stream like read support crypto: Fix possible stack out-of-bound error drivers: irqchip: qcom: Add MSM8953 pin data for MPM defconfig: Enable EXT4 configs drivers: iio: enable compile for TDK sensor power: smb2: Enable read/writing of Type-C Rp value usb: gadget: f_mass_storage: Remove runtime async resume drivers: iio: add Makefile and Kconfig for TDK chirp sensor backlight: qcom-wled: Add "qcom,sync-dly" device tree property usb: dwc3: Issue ENDTRANSFER cmd on ep0 unconditionally coresight: disable the path when enable source link fail qcom: fg-memif: correct timeout condition for memory grant power: qpnp-fg-gen3: Add a property to reset FG BCL device power_supply: Add FG_RESET_CLOCK property qseecom: Check error when allocating coherent buffer defconfig: Enable CPR Regulator for msm8937go diag: Acquire spinlock for list delete operation rpm-smd: Remove redundant spinlocks which are not required regulator: qpnp-lcdb: Disable step voltage ramp for PM8150L V3 power: smb5-lib: Query POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN defconfig: Enable Incremental FS support for msm8937_32go media/dvb: Deregister dma buffers fom shmbridge msm: kgsl: Show max gpu temperature USB: pd: Add support for enabling PD2.0 only as source usb: gadget: Clear transfer started flag if endxfer cmd times out backlight: qcom-spmi-wled: Change the SYNC toggle sequence USB: pd: Restart host mode in high speed if no usb3 & dp concurrency defconfig: Initial defconfig files for MSM8937_32go TDK-Robotics-RB5 drivers source code files diag: Update event and log mask code latest range clk: qcom: smd-rpm: Add RPM-SMD clock support for QM215 fs: crypto: Add support for legacy pfk based FBE fastrpc : fastrpc porting for kernel 4.19 SPF targets qdss_bridge: fix memory leak issue bindings: clock: qcom: Add support for clock IDs for QM215 drivers: char: msm_smd_pkt: Return error in case driver is not ready kernel: driver: Added support msm_smd_pkt driver dt-bindings: clock: Add support for GCC clock ids for SDM429 wigig_sensing: treat data ready as deep sleep exit when needed usb: dwc3: gadget: Replace dev with its parent sysdev in ep_disable usb: dwc3: gadget: Check controller status with endpoint enable/disable coresight: Make coresight functions as inline cnss2: WAR to trigger self-recovery for link recover callback net: qrtr: Excessive logging casuing boot failure pinctrl: Add support for msm8917 pinctrl pinctrl: Add support for msm8937 pinctrl msm: pcie : Extend link recovery for config space access failure cnss_prealloc: Add a 128kB to prealloc pool rpmsg: qcom_smd: allow smd create device if remote state is closing usb: pd: Add support to disable pps capability nl80211: add error messages to nl80211_parse_chandef() cnss2: Increase prealloc table to satisfy latest driver requirement power: smb5-lib: Add additional check to exit charge-termination WA cnss2: Dump mhi debug registers on receiving mhi WAKE event cb msm:ADSPRPC :Fix to avoid Use after free in fastrpc_internal_munmap qseecom: Add boundary checks between two subsequent fields diag: Read from USB without holding spinlock serial:msm_geni_serial: Handling the cts counter in uart driver arm64: fix bootloader_memory_limit usb: phy: qusb2: Update tune value for host mode coresight: cti: Solve boot up issue cnss2: retry mhi suspend in case packets are pending in MHI layer clk: qcom: mdss: Enable mdss 28lpm pll driver msm: pcie : Notify client driver on reading FF's msm: kgsl: Use pid struct to find the process to reclaim mm: process_reclaim: pass pid struct instead of tgid msm: kgsl: Change vma->vm_file to shmem file qcom: step-chg-jeita: Add support for jeita fcc scaling mm: process_reclaim: skip target_vma mhi: core: Check PCIe link status before accessing MHI registers power: qpnp-smb5: Add DT option to enable JEITA-ARB handling power: smb5-lib: Improve the charge-termination WA handling msm: pci: print PCIE LTSSM state at DRV suspend and resume msm: kgsl: Deregister gpu address on memdesc_sg_virt failure diag: Handle drops for diag over rpmsg diag: Enable diag over rpmsg communication for modem diag: Enable diag over rpmsg communication for wcnss usb: gadget: gsi: Ensure the doorbell is blocked before suspend drivers: irqchip: qcom: Add MSM8937 pin data for MPM ARM: qcom: Add board config support for qm215 soc: qcom: socinfo: Add supprot for QM215 QRD soc-id soc: qcom: socinfo: Add support for msm8917 soc-id soc: qcom: socinfo: add support for sdm429 and sdm439 soc: qcom: socinfo: Add support for msm8937 soc-id arm/arm64: Kconfig: Add support for qm215 ARM: qcom: Add board config support for msm8917 arm64: Kconfig: Add ARCH_SDM439 and ARCH_SDM429 support arm64: Kconfig: Add support for msm8937 on msm-4.9 msm: adsprpc: null pointer check for sctx regulator: qpnp-lcdb: fix race between SC interrupt and lcdb enable msm: kgsl: Protect the memdesc->gpuaddr in SVM use cases msm: kgsl: Stop using memdesc->usermem net: sch_generic: fix the missing new qdisc assignment usb: gadget: composite: Add spinlock protection for usb string descriptor msm: kgsl: add condition to check gpuhtw_llc support icnss: Add code to send qdss mode and sysfs interface for qdss icnss: Add code to downdload qdss trace config leds: qpnp-flash-v2: Fix out-of-bound array access mm: skip speculative path for non-anonymous COW faults ARM: msm: Add board config support for 32 bit bengal apq iot cnss2: Add code to fix a print error in update timestamp api icnss2: change to avoid device crash if RF card is not present mmc: sdhci-msm: read this reg IPCAT_MINOR_MASK to sdhc host pci: msm: Add support for linkdown recovery on hot reset net: qrtr: print error case for qrtr receive spi: spi-geni-qcom: Calculate transfer timeout dynamically spi: spi-geni-qcom: Configure DFS index and clk before doing set rate cnss2: Add delay for pci link training retries Revert "msm: kgsl: Add GPUCC register dumps to A6xx GPU snapshot" cnss2: Add code to handle idle-restart failure gracefully icnss2: Clear SMP2P data during SSR Revert "msm: kgsl: Add GPUCC register dumps to A6xx GPU snapshot" net: qualcomm: rmnet: memset before sending genl response diag: Add support for querying diagid for wpss subsystem wil6210: add ability to help debug tx latency regulator: cpr: add snapshot of cpr-regulator driver scsi: ufshcd: Fix double release of hba walt: Add window rollover trace event msm: kgsl: Correct the refcount on current process PID USB: gadget: Add support for superspeed plus for UAC2 & UVC serial: msm_geni_serial: Perform Abort sequence for cancel failure serial: msm_geni_serial: Correct start rx sequence serial: msm_geni_serial: Pull RFR before stop_rx for uart Revert "nl80211: fix non-split wiphy information" qseecom: use legacy command for slateapp USB: f_uac2: Update terminal types as mic and speaker defconfig: kona: Enable USB UVC drivers usb: gadget: f_uvc: Fix video streaming quality issues usb: gadget: f_uvc: Fix crash on disconnect/connect during streaming msm: npu: Prevent unpaired power vote/unvote via sysfs node qdss_bridge: fix use-after-free is on cdev_put defconfig: set CONFIG_HZ = 250 for Bengal USB: uvc_video: Check for return value before halt bulk endpoint USB: configfs: Clear deactivation flag in configfs_composite_unbind() msm: ADSPRPC: Add check to avoid out of bound scenario uapi: ipa: Support uc header proc ctx for DSCP insertion usb: dwc3: core: Destroy ipc log context on remove msm: ipa: add check to see if pm client is not NULL cnss2: Fix KW issues for pointer check and variable init ANDROID: vfs: d_canonical_path for stacked FS msm: ipa3: Add change to increase timeout value defconfig: arm64: msm: enable CONFIG_RB5_GPIOS_ENABLE msm: driver: Add driver to enable RB5 GPIOs msm: ADSPRPC: Reset debug buffer allocation check flag power: smb1355: Extend minoff-time and dead-time for SMB1355 defconfig: arm64: msm: enable CONFIG_RB5_FAN_CONTROLLER msm: fan: Add driver to control fan on RB5 HID: qvr: Remove device pointer on disconnect usb: gadget: uvc: Update frame size as per frame type usb: gadget: f_uvc: Fix incorrect frame indexing usb: gadget: uvc: Add support for UVC 1.5 usb: gadget: Add support for UVC function f2fs: prepare a waiter before entering io_schedule f2fs: fix deadlock between quota writes and checkpoint cnss2: Add api to get pci reg dump for hang data power: smb1398-charger: Toggle UVLO-config on USB removal and shutdown msm: ipa3: Add support PM api in ipav3 fs: crypto: support IV_INO_LBLK_32 for legacy (V1) format msm: ipa3: Fix to unmap LOW LAT consumer pipe buffers msm: pcie: Dump PCIe registers for hang event trace: Fix race in trace_open and buffer resize call msm: ipa4: Add change to stop netdev msm: fbdev: dp: send video notiification after audio teardown msm: kgsl: Poll a6x crashdumper register memory for status usb: dwc3-msm: Rectify 64 bit dma address programming for GSI msm: ADSPRPC: Enable ram dumps collection f2fs: should avoid inode eviction in synchronous path i3c: i3c-master-qcom-geni: Add HW and FW version read support msm: ipa3: Add check to validate rule_cnt i3c: i3c-master-qcom-geni: Manage driver suspend in late PM stage net: qrtr: Use cyclic idr allocator for port assignment mmc: core: change judgement for card busy detection msm: ADSPRPC: Handle third party applications msm:ipa4: Fix race condition msm: kgsl: Check for gmu prealloc failure only in case of prealloc request msm: ipa: Use kvfree instead of kfree scsi : ufs-qcom: Add provision to set qcom specific supplies in LPM fbdev: msm: update fb_release sequence mhi: core: Increase RSC credit to 10 HID: qvr: wake up after acknowledgment from viewer icnss: Update FW_INIT_DONE QMI indication with hang event params wil6210: add max_mcs attribute cnss2: Check link status before setting wlaon_pwr_ctrl registers defconfig: arm64: msm: Enable USB RMNET & RNDIS using IPA over BAM2BAM msm: kgsl: Add apb_pclk to the clock list and increase max clock count usb: gadget: Add snapshot of USB RMNET Function driver drivers: soc: qcom: Add usb bam changes usb: gadget: f_qc_rndis: Add RNDIS support using IPA over BAM2BAM serial: msm_geni_serial: Add enable/disable of dma irq bits serial: msm_geni_serial: Don't queue the rx dma buffer in stop rx msm: kgsl: Allow I/O coherency on imported buffers if we can drivers: phy: ufs: Remove the condition check to calibrate UFS Phy Reverting usb changes defconfig: Sync with Android-4.19 configs clk: qcom: gcc: Update the halt flags for clocks on SDM660 power: qpnp-qg: Expose CHARGE_COUNTER_SHADOW power supply property cnss2: Check for BT Enable GPIO in QCA6490 & QCA6390 icnss2: Avoid race between soc wake release threads icnss2: Add code for SSR dump collection feature for moselle nl80211: fix NL80211_ATTR_HE_6GHZ_CAPABILITY usage cfg80211: Indicate support 6GHz band in kernel cfg80211: treat 6 GHz channels as valid regardless of capability cfg80211: require HE capabilities for 6 GHz band cfg80211: reject HT/VHT capabilities on 6 GHz band cfg80211: add and expose HE 6 GHz band capabilities cfg80211: handle 6 GHz capability of new station ieee80211: add HE ext EIDs and 6 GHz capability defines ieee80211: add code to obtain and parse 6 GHz operation field cfg80211: add a helper to identify 6 GHz PSCs cfg80211: adapt to new channelization of the 6GHz band cfg80211: fix 6 GHz frequencies to kHz ieee80211: update HE IEs to D4.0 spec mac80211: update HE IEs to D3.3 mac80211: update HE operation fields to D3.0 ieee80211: remove redundant leading zeroes iwlwifi: split HE capabilities between AP and STA netlink: add ethernet address policy types netlink: add NLA_REJECT policy type wireless: align to draft 11ax D3.0 mac80211: Add he_capa debugfs entry cfg80211: express channels with a KHz component cfg80211: Add support for 60GHz band channels 5 and 6 cfg80211: apply same mandatory rate flags for 5GHz and 6GHz cfg80211: ibss: use 11a mandatory rates for 6GHz band operation clk: qcom: gpucc: Add support for new clock frequency for Lagoon soc: qcom: minidump: Change the way to locate log_buf qcom-cpufreq: Removing lmh-dcvs parsing in ready callback usb: dwc3: msm: allow suspend in host mode icnss2: Add support for host triggered recovery Bluetooth: Implement a minimum off-time for AON discharge issue defconfig: sdm660: Enable CONFIG_HID_NINTENDO for sdm660 defconfig: For support api_30 kernel changes defconfig: Sync with Android-4.19 configs defconfig: Disable CRYPTO_MD4 config defconfig: Enable VETH config msm:adsprpc: Prevent use after free in fastrpc_set_process_info Revert "ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple" Correct the FM port numbers for Chk 3.x net/ipv4: always honour route mtu during forwarding usb: dwc3: Ensure blocking_sync waits until host mode starts or stops usb: dwc3: gadget: Fix double add due to cleanup_cancelled_request ANDROID: fuse: Add support for d_canonical_path ANDROID: vfs: add d_canonical_path for stacked filesystem support clk: qcom: clk-debug: Add support for debug clock API's cfg80211: use same IR permissive rules for 6GHz band cfg80211: add 6GHz in code handling array with NUM_NL80211_BANDS entries cfg80211: extend ieee80211_operating_class_to_band() for 6GHz cfg80211: util: add 6GHz channel to freq conversion and vice versa cfg80211: add 6GHz UNII band definitions nl80211: add 6GHz band definition to enum nl80211_band ANDROID: Temporarily disable XFRM_USER_COMPAT filtering msm: ipa3: Add debug logs to check unregister netdev completion time Revert "clk: Evict unregistered clks from parent caches" ANDROID: GKI: Enable DEBUG_INFO_DWARF4 timekeeping/vsyscall: Prevent math overflow in BOOTTIME update UPSTREAM: mm/sl[uo]b: export __kmalloc_track(_node)_caller BACKPORT: xfrm/compat: Translate 32-bit user_policy from sockptr BACKPORT: xfrm/compat: Add 32=>64-bit messages translator UPSTREAM: xfrm/compat: Attach xfrm dumps to 64=>32 bit translator UPSTREAM: xfrm/compat: Add 64=>32-bit messages translator BACKPORT: xfrm: Provide API to register translator module ANDROID: Publish uncompressed Image on aarch64 FROMLIST: crypto: arm64/poly1305-neon - reorder PAC authentication with SP update UPSTREAM: crypto: arm64/chacha - fix chacha_4block_xor_neon() for big endian UPSTREAM: crypto: arm64/chacha - fix hchacha_block_neon() for big endian msm: ipa: fix the use-after-free on qmi framework in ssr scenario fscrypt: Handle support for v1 encryption policy ANDROID: GKI: update the ABI xml spi: spi_qsd: Add ipc logging for spi driver qbt_handler: Memset userspace struct to zero drivers: soc: qcom: Port bam dmux driver drivers: soc: qcom: Add bam dmux driver support msm: kgsl: Compare pid pointer instead of TGID for a new process power: qpnp-smb5: Update legacy cable detection logic in bootup spi: spi_qsd: Add Shared EE property check for spi soc: qcom: Correct the module description for llcc-orchid usb: dwc3: core: Add ipc logs when sg lists are used icnss2: Send power save enter/exit via SMP2P ANDROID: clang: update to 11.0.5 FROMLIST: arm64: link with -z norelro regardless of CONFIG_RELOCATABLE defconfig: Enable CONFIG_LEGACY_ENERGY_MODEL_DT for sdm660 scsi: ufs: Increase fDeviceInit flag poll time to 5sec msm: pcie: update with link power on check for user PCIe resume scsi: ufs: Fix ufshcd_hold dead loop issue if error recovery is handing defconfig: arm64: msm: enable CONFIG_FORCE_ALLOC_FROM_DMA_ZONE ANDROID: GKI: enable CONFIG_WIREGUARD UPSTREAM: wireguard: peerlookup: take lock before checking hash in replace operation UPSTREAM: wireguard: noise: take lock when removing handshake entry from table UPSTREAM: wireguard: queueing: make use of ip_tunnel_parse_protocol UPSTREAM: net: ip_tunnel: add header_ops for layer 3 devices UPSTREAM: wireguard: receive: account for napi_gro_receive never returning GRO_DROP UPSTREAM: wireguard: device: avoid circular netns references UPSTREAM: wireguard: noise: do not assign initiation time in if condition UPSTREAM: wireguard: noise: separate receive counter from send counter UPSTREAM: wireguard: queueing: preserve flow hash across packet scrubbing UPSTREAM: wireguard: noise: read preshared key while taking lock UPSTREAM: wireguard: selftests: use newer iproute2 for gcc-10 UPSTREAM: wireguard: send/receive: use explicit unlikely branch instead of implicit coalescing UPSTREAM: wireguard: selftests: initalize ipv6 members to NULL to squelch clang warning UPSTREAM: wireguard: send/receive: cond_resched() when processing worker ringbuffers UPSTREAM: wireguard: socket: remove errant restriction on looping to self UPSTREAM: wireguard: selftests: use normal kernel stack size on ppc64 UPSTREAM: wireguard: receive: use tunnel helpers for decapsulating ECN markings UPSTREAM: wireguard: queueing: cleanup ptr_ring in error path of packet_queue_init UPSTREAM: wireguard: send: remove errant newline from packet_encrypt_worker UPSTREAM: wireguard: noise: error out precomputed DH during handshake rather than config UPSTREAM: wireguard: receive: remove dead code from default packet type case UPSTREAM: wireguard: queueing: account for skb->protocol==0 UPSTREAM: wireguard: selftests: remove duplicated include <sys/types.h> UPSTREAM: wireguard: socket: remove extra call to synchronize_net UPSTREAM: wireguard: send: account for mtu=0 devices UPSTREAM: wireguard: receive: reset last_under_load to zero UPSTREAM: wireguard: selftests: reduce complexity and fix make races UPSTREAM: wireguard: device: use icmp_ndo_send helper UPSTREAM: wireguard: selftests: tie socket waiting to target pid UPSTREAM: wireguard: selftests: ensure non-addition of peers with failed precomputation UPSTREAM: wireguard: noise: reject peers with low order public keys UPSTREAM: wireguard: allowedips: fix use-after-free in root_remove_peer_lists UPSTREAM: net: skbuff: disambiguate argument and member for skb_list_walk_safe helper UPSTREAM: net: introduce skb_list_walk_safe for skb segment walking UPSTREAM: wireguard: socket: mark skbs as not on list when receiving via gro UPSTREAM: wireguard: queueing: do not account for pfmemalloc when clearing skb header UPSTREAM: wireguard: selftests: remove ancient kernel compatibility code UPSTREAM: wireguard: allowedips: use kfree_rcu() instead of call_rcu() UPSTREAM: wireguard: main: remove unused include <linux/version.h> UPSTREAM: wireguard: global: fix spelling mistakes in comments UPSTREAM: wireguard: Kconfig: select parent dependency for crypto UPSTREAM: wireguard: selftests: import harness makefile for test suite UPSTREAM: net: WireGuard secure network tunnel UPSTREAM: timekeeping: Boot should be boottime for coarse ns accessor UPSTREAM: timekeeping: Add missing _ns functions for coarse accessors UPSTREAM: icmp: introduce helper for nat'd source address in network device context UPSTREAM: crypto: poly1305-x86_64 - Use XORL r32,32 UPSTREAM: crypto: curve25519-x86_64 - Use XORL r32,32 UPSTREAM: crypto: arm/poly1305 - Add prototype for poly1305_blocks_neon UPSTREAM: crypto: arm/curve25519 - include <linux/scatterlist.h> UPSTREAM: crypto: x86/curve25519 - Remove unused carry variables UPSTREAM: crypto: x86/chacha-sse3 - use unaligned loads for state array UPSTREAM: crypto: lib/chacha20poly1305 - Add missing function declaration UPSTREAM: crypto: arch/lib - limit simd usage to 4k chunks UPSTREAM: crypto: arm[64]/poly1305 - add artifact to .gitignore files UPSTREAM: crypto: x86/curve25519 - leave r12 as spare register UPSTREAM: crypto: x86/curve25519 - replace with formally verified implementation UPSTREAM: crypto: arm64/chacha - correctly walk through blocks UPSTREAM: crypto: x86/curve25519 - support assemblers with no adx support UPSTREAM: crypto: chacha20poly1305 - prevent integer overflow on large input UPSTREAM: crypto: Kconfig - allow tests to be disabled when manager is disabled UPSTREAM: crypto: arm/chacha - fix build failured when kernel mode NEON is disabled UPSTREAM: crypto: x86/poly1305 - emit does base conversion itself UPSTREAM: crypto: chacha20poly1305 - add back missing test vectors and test chunking UPSTREAM: crypto: x86/poly1305 - fix .gitignore typo UPSTREAM: crypto: curve25519 - Fix selftest build error UPSTREAM: crypto: {arm,arm64,mips}/poly1305 - remove redundant non-reduction from emit UPSTREAM: crypto: x86/poly1305 - wire up faster implementations for kernel UPSTREAM: crypto: x86/poly1305 - import unmodified cryptogams implementation UPSTREAM: crypto: poly1305 - add new 32 and 64-bit generic versions UPSTREAM: crypto: lib/curve25519 - re-add selftests UPSTREAM: crypto: arm/curve25519 - add arch-specific key generation function UPSTREAM: crypto: chacha - fix warning message in header file UPSTREAM: crypto: arch - conditionalize crypto api in arch glue for lib code UPSTREAM: crypto: lib/chacha20poly1305 - use chacha20_crypt() UPSTREAM: crypto: x86/chacha - only unregister algorithms if registered UPSTREAM: crypto: chacha_generic - remove unnecessary setkey() functions UPSTREAM: crypto: lib/chacha20poly1305 - reimplement crypt_from_sg() routine UPSTREAM: crypto: chacha20poly1305 - import construction and selftest from Zinc UPSTREAM: crypto: arm/curve25519 - wire up NEON implementation UPSTREAM: crypto: arm/curve25519 - import Bernstein and Schwabe's Curve25519 ARM implementation UPSTREAM: crypto: curve25519 - x86_64 library and KPP implementations UPSTREAM: crypto: lib/curve25519 - work around Clang stack spilling issue UPSTREAM: crypto: curve25519 - implement generic KPP driver UPSTREAM: crypto: curve25519 - add kpp selftest UPSTREAM: crypto: curve25519 - generic C library implementations UPSTREAM: crypto: blake2s - x86_64 SIMD implementation UPSTREAM: crypto: blake2s - implement generic shash driver UPSTREAM: crypto: testmgr - add test cases for Blake2s UPSTREAM: crypto: blake2s - generic C library implementation and selftest UPSTREAM: crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation UPSTREAM: crypto: arm/poly1305 - incorporate OpenSSL/CRYPTOGAMS NEON implementation i3c: i3c-master-qcom-geni: Handle timeout for DMA FSM reset UPSTREAM: crypto: arm64/poly1305 - incorporate OpenSSL/CRYPTOGAMS NEON implementation i3c: i3c-master-qcom-geni: Save master device info to debug list UPSTREAM: crypto: x86/poly1305 - expose existing driver as poly1305 library UPSTREAM: crypto: x86/poly1305 - depend on generic library not generic shash UPSTREAM: crypto: poly1305 - expose init/update/final library interface UPSTREAM: crypto: x86/poly1305 - unify Poly1305 state struct with generic code UPSTREAM: crypto: poly1305 - move core routines into a separate library UPSTREAM: crypto: chacha - unexport chacha_generic routines UPSTREAM: crypto: mips/chacha - wire up accelerated 32r2 code from Zinc UPSTREAM: crypto: mips/chacha - import 32r2 ChaCha code from Zinc UPSTREAM: crypto: arm/chacha - expose ARM ChaCha routine as library function UPSTREAM: crypto: arm/chacha - remove dependency on generic ChaCha driver UPSTREAM: crypto: arm/chacha - import Eric Biggers's scalar accelerated ChaCha code UPSTREAM: crypto: arm64/chacha - expose arm64 ChaCha routine as library function UPSTREAM: crypto: arm64/chacha - depend on generic chacha library instead of crypto driver UPSTREAM: crypto: arm64/chacha - use combined SIMD/ALU routine for more speed UPSTREAM: crypto: arm64/chacha - optimize for arbitrary length inputs UPSTREAM: crypto: x86/chacha - expose SIMD ChaCha routine as library function UPSTREAM: crypto: x86/chacha - depend on generic chacha library instead of crypto driver UPSTREAM: crypto: chacha - move existing library code into lib/crypto UPSTREAM: crypto: lib - tidy up lib/crypto Kconfig and Makefile UPSTREAM: crypto: chacha - constify ctx and iv arguments UPSTREAM: crypto: x86/poly1305 - Clear key material from stack in SSE2 variant i3c: i3c-master-qcom-geni: Log error if DMA mode fails defcong: sdm660 : Adding support to IPA driver msm: ipa: Add ipa rm support for ipa_v2 UPSTREAM: crypto: xchacha20 - fix comments for test vectors UPSTREAM: crypto: xchacha - add test vector from XChaCha20 draft RFC UPSTREAM: crypto: arm64/chacha - add XChaCha12 support UPSTREAM: crypto: arm64/chacha20 - refactor to allow varying number of rounds UPSTREAM: crypto: arm64/chacha20 - add XChaCha20 support UPSTREAM: crypto: x86/chacha - avoid sleeping under kernel_fpu_begin() UPSTREAM: crypto: x86/chacha - yield the FPU occasionally UPSTREAM: crypto: x86/chacha - add XChaCha12 support UPSTREAM: crypto: x86/chacha20 - refactor to allow varying number of rounds UPSTREAM: crypto: x86/chacha20 - add XChaCha20 support UPSTREAM: crypto: x86/chacha20 - Add a 4-block AVX-512VL variant UPSTREAM: crypto: x86/chacha20 - Add a 2-block AVX-512VL variant UPSTREAM: crypto: x86/chacha20 - Add a 8-block AVX-512VL variant UPSTREAM: crypto: x86/chacha20 - Add a 4-block AVX2 variant UPSTREAM: crypto: x86/chacha20 - Add a 2-block AVX2 variant UPSTREAM: crypto: x86/chacha20 - Use larger block functions more aggressively UPSTREAM: crypto: x86/chacha20 - Support partial lengths in 8-block AVX2 variant UPSTREAM: crypto: x86/chacha20 - Support partial lengths in 4-block SSSE3 variant UPSTREAM: crypto: x86/chacha20 - Support partial lengths in 1-block SSSE3 variant msm: ipa3: Add low-level IPA client support net: support __alloc_skb to always use GFP_DMA msm: ipa2: Add changes compatible to kernel-4.19 msm: ipa2: Add change to fix ipa padding msm: ipa: Add Kconfig changes of IPA2 driver msm: ipa2: Add changes compatible to kernel-4.14 i3c: i3c-master-qcom-geni: Fix DMA and FIFO mode timeout scenario ANDROID: GKI: Enable CONFIG_USB_ANNOUNCE_NEW_DEVICES msm: ipa: Add support of IPA2 driver scsi: ufs: reomove Rst_N pulling up action in ufshcd_resume() serial: msm_geni_serial: Add new UART IPC log file in DMA mode serial: msm_geni_serial: Add delay for rx invalid transfer msm_geni_serial: Add ioctl for adding new IPC log in uart msm: kgsl: Don't allow re-importing memory owned by KGSL serial: msm_geni_serial: memset RX buffer to Zero icnss2: Avoid race between SOC WAKE REQ/RESP ANDROID: GKI: Enable CONFIG_X86_X2APIC i3c: i3c-master-qcom-geni: Manage probe time resources fbdev: msm: disable cpu sync during dma_buf_map_attachment scsi: ufs: Add back a missing sanity check to ufshcd_read_desc_param() icnss: check SKIP_QMI test bit for exported qmi messages ANDROID: move builds to use gas prebuilts i3c: i3c-master-qcom-geni: Force the xfer mode as DMA mode msm: ipa3: Fix to use proper clock timer i3c: i3c-master-qcom-geni: Fix IBI and Hot join related issues msm: ipa3: Add change to not reset HOLB timer UPSTREAM: binder: fix UAF when releasing todo list cnss2: Add support for PCIE gen switch FROMLIST: arm64: vdso32: Allow ld.lld to properly link the VDSO mmc: core: Fix clk scaling when card max freq below 50MHz msm: ipa3: Send enable force clear only for producer pipe sched/tune: Fix improper accounting of tasks usb: dwc3: Stop active transfer on control endpoints Add support for block disk encryption mmc: host: Use right parameter for ext4 plus eMMC mmc: host: reprogram the key to cover the invalid config case Fix OTA issue with vts fixes for new fbe framework msm: kgsl: Remove dev_err() from fenced write loop uapi: sound: Fix compilation error defconfig: msm: Enable FS related configs for Android R net:sockev: hold file reference till the sock event is sent net_sched: Add flow control support to prio qdisc msm: camera: Fix for memory leak defconfig: kona: Enable dm-crypt driver soc: qcom: Fix memcpy operations in ramdump_read md: dm-default-key: Use system sector size for SDHCI devices defconfig: msm: Enable CONFIG_STATIC_USERMODEHELPER for bengal_32 fdt: Update CRC check for rng-seed usb: phy: snps: Enable auto resume feature only in host mode msm: ipa: Fix rndis client disconnection gracefully icnss: reject idle restart if wlan driver unregistered soc: qcom: Add LLCC driver for Orchid icnss2: Decrement soc wake ref count fbdev: msm: remove mappings before iommu detach clk: qcom: mdss: Update dfps data struct for FB targets usb: pd: Register typec partner in case AAA is connected binder: update low_latency selection for binder transactions sched/walt: Improve the scheduler msm: kgsl: Use regulator_is_enabled api when gpu-quirk-cx-gdsc is defined icnss2: Send enter power save after driver suspend mmc: host: Update HS400 timing mode before performing tuning defconfig: Enable CONFIG_UTS_NS for sdm660 trace: f2fs: Fix kasan slab-out-of-bounds ANDROID: use arm-linux-androidkernel- for CROSS_COMPILE_COMPAT ANDROID: build.config.common: enable LLVM=1 NFC: Add support for core init command icnss2: Fix race condition during SOC wake req/release msm: kgsl: Don't wait for room in context queue when context is invalidated dt-bindings: msm: Add bindings for MP limit fuse support fbdev: msm: set smmu cb domain attached during probe defconfig: enable SDE rotator mm/Kconfig: forcing allocators to return ZONE_DMA32 memory power: smb5: Fix LPD flag for PMI632 ANDROID: GKI: prevent removal of monitored symbols firmware: qcom: Fix hyp_log issue soc: qcom: Fix smcinvoke_obj->fd assignment drm: increase max limit of drm open count to 128 scsi: ufs: Fix unexpected values get from ufshcd_read_desc_param() usb: gadget: Don't giveback request if ep command times out icnss2: Avoid calibration during SSR of WCN6750 ANDROID: Refresh ABI.xmls with libabigail 1.8.0-98bbf30d edac: improve gold CPU cache way parsing msm: kgsl: Update clk_set_rate() sequence for bimc_gpu_clk scsi: ufs: Fix ufs power down/on specs violation in suspend/resume path defconfig: msm: Enable CONFIG_STATIC_USERMODEHELPER for bengal_32 fdt: Update CRC check for rng-seed defconfig: Enable blk-crypto-fallback to handle sw crypto request md: dm-default-key: Use system sector size for SDHCI devices msm: sde: rotator: enable sde rotator msm: pcie: provide client the ability to control PCIe target_link_speed qcom: qpnp-fg-gen3: Continue fg_gen3_probe() when !DEBUG_FS dcc_v2: fix 1 write 1 read register configuration fail issue leds: qpnp-flash-v2: Acquire the bms_psy handle at runtime regulator: qpnp-labibb: Don't handle LAB_VREG_OK in TTW mode for pmi8998 regulator: qpnp-labibb: Add sysfs class to enable/disable the irq regulator: qpnp-lcdb: Disable the SC irq only for PM660L V1.1 and below regulator: qpnp-lcdb: Add sysfs class to enable/disable the irq cnss2: Enable self-recovery only when host driver detects linkdown ANDROID: drop KERNEL_DIR setting in build.config.common cnss2: Release qmi handle after server exit UPSTREAM: driver core: Avoid deferred probe due to fw_devlink_pause/resume() UPSTREAM: driver core: Rename dev_links_info.defer_sync to defer_hook UPSTREAM: driver core: Don't do deferred probe in parallel with kernel_init thread msm: cvp: Avoid releasing non-existent ARP buffer cnss_utils: Update wlfw power save enter/exit qmi message msm: mink: Fix copy_to_user issue crypto: Fix possible stack out of bound error mhi: core: Extend mhi_device_get_sync_atomic() for panic cases cnss2: Log a message after assert/de-assert WLAN_EN GPIO cnss2: Assert when power on retry reaches maximum usb: dwc3: gadget: Properly handle failed kick_transfer f2fs: remove blk_plugging in block_operations power: smblite-lib: Reduce the ICL immediately when flash is active qseecom: Propagate correct return value from TZ mmc: Remove unused code ANDROID: Refresh ABI.xmls with libabigail 1.8.0-1dca710a irqchip: gic-v3: Add support to get pending irqs serial: msm_geni_serial: Don't use WARN_ON for console uart mmc: core: Fix issue of no clk scaling upon previous scaling failure power: smb1390: Fix taper condition for VPH configuration cnss2: Change to add prints on link down callback dm-crypt: Skip encryption if bio is fscrypto or blk-crypto encrypted power: smblite-lib/smb5-lib: Add partner registration for microusb otg clk: qcom: rpmh: Update new clocks support on LitoMagnus arm: dma-mapping.c: add cpu sync in map_sg and unmap_sg defconfig: Enable blk-crypto-fallback to handle sw crypto request dt-bindings: clock: qcom: Add support for RPMH clocks msm: ipa4: fix the unclock gsi IPA register access clk: qcom: Add BIMC logging support during kernel panic dt-bindings: clock: Add support for BIMC clock usb: core: Don't wait for completion of urbs msm: kgsl: Enable process reclaim for A610 fuse: fix page dereference after free msm: media: uapi: Redefine NV12 format with different alignment sched/walt: Fix a potential accounting issue during window size change UPSTREAM: arm64: vdso: Build vDSO with -ffixed-x18 mhi: core: Add checks for bhie offsets ANDROID: KMI symbol lists: migrate section name usb: phy: qusb: Set the voltage to regulator according to soc capacity cnss2: Collect shadow registers for RDDM scenario mm: slub: Add debugfs interface to capture slub allocs owner msm: kgsl: Don't skip gmufw preallocations during firmware read icnss2: Export API to host driver to exit power save msm: ipa: stay in NAPI mode when default pipe has low credits vidc_3x: Fix crash in user build msm: mink: Fix copy_to_user issue msm: ipa: update the iommu mapping for WDI rings mmc: Port changes for supporting SDIO functionality to 4.19 kernel ANDROID: ABI: refresh with latest libabigail 94f5d4ae ... Conflicts: .gitignore Documentation/arm64/tagged-address-abi.rst Makefile android/abi_gki_aarch64 android/abi_gki_aarch64.xml android/abi_gki_aarch64_cuttlefish android/abi_gki_aarch64_qcom arch/Kconfig arch/arm/Kconfig arch/arm/configs/vendor/msm8937-perf_defconfig arch/arm/configs/vendor/msm8937_32go-perf_defconfig arch/arm/configs/vendor/msm8937_32go_defconfig arch/arm/configs/vendor/msm8937_defconfig arch/arm/crypto/curve25519-core.S arch/arm/crypto/poly1305-glue.c arch/arm64/Kconfig arch/arm64/boot/dts/vendor/bindings/bus/ti-sysc.txt arch/arm64/boot/dts/vendor/bindings/display/mediatek/mediatek,dpi.txt arch/arm64/boot/dts/vendor/bindings/iio/multiplexer/io-channel-mux.txt arch/arm64/boot/dts/vendor/bindings/net/fsl-fman.txt arch/arm64/boot/dts/vendor/bindings/sound/wm8994.txt arch/arm64/boot/dts/vendor/bindings/usb/dwc3.txt arch/arm64/configs/gki_defconfig arch/arm64/configs/vendor/bengal-perf_defconfig arch/arm64/configs/vendor/bengal_defconfig arch/arm64/configs/vendor/kona-perf_defconfig arch/arm64/configs/vendor/kona_defconfig arch/arm64/configs/vendor/lito-perf_defconfig arch/arm64/configs/vendor/lito_defconfig arch/arm64/configs/vendor/sdm660-perf_defconfig arch/arm64/configs/vendor/sdm660_defconfig arch/arm64/crypto/poly1305-glue.c arch/arm64/include/asm/alternative.h arch/arm64/include/asm/cpucaps.h arch/arm64/include/asm/cputype.h arch/arm64/include/asm/lse.h arch/arm64/include/asm/vdso/compat_barrier.h arch/arm64/include/asm/vdso/compat_gettimeofday.h arch/arm64/kernel/asm-offsets.c arch/arm64/kernel/cpu_errata.c arch/arm64/kernel/vdso.c arch/arm64/kernel/vdso/Makefile arch/arm64/kernel/vdso32/Makefile arch/arm64/mm/mmu.c arch/mips/crypto/Makefile arch/mips/crypto/poly1305-glue.c arch/mips/vdso/Makefile arch/x86/configs/gki_defconfig arch/x86/crypto/Makefile arch/x86/crypto/blake2s-glue.c arch/x86/crypto/poly1305_glue.c arch/x86/include/asm/vgtod.h arch/x86/kernel/cpu/common.c build.config.aarch64 build.config.common build.config.gki_kasan build.config.x86_64 crypto/Kconfig crypto/Makefile crypto/blake2s_generic.c crypto/testmgr.c crypto/testmgr.h drivers/android/binder_internal.h drivers/android/binderfs.c drivers/base/core.c drivers/base/power/wakeup_stats.c drivers/block/loop.c drivers/char/Kconfig drivers/char/adsprpc.c drivers/char/diag/diagfwd_peripheral.c drivers/char/random.c drivers/clk/qcom/clk-debug.c drivers/crypto/msm/qcedev.c drivers/devfreq/governor_gpubw_mon.c drivers/dma-buf/dma-buf.c drivers/firmware/qcom/tz_log.c drivers/gpu/drm/drm_connector.c drivers/gpu/drm/drm_mipi_dsi.c drivers/gpu/drm/drm_prime.c drivers/gpu/drm/virtio/virtgpu_ioctl.c drivers/gpu/msm/adreno_debugfs.c drivers/gpu/msm/kgsl.c drivers/gpu/msm/kgsl_device.h drivers/gpu/msm/kgsl_drawobj.c drivers/gpu/msm/kgsl_pool.c drivers/gpu/msm/kgsl_pwrctrl.c drivers/gpu/msm/kgsl_pwrctrl.h drivers/gpu/msm/kgsl_reclaim.c drivers/gpu/msm/kgsl_sharedmem.c drivers/gpu/msm/kgsl_timeline.c drivers/hid/hid-ids.h drivers/hid/hid-quirks.c drivers/hwtracing/coresight/coresight-etm-perf.c drivers/hwtracing/coresight/coresight-etm4x.c drivers/hwtracing/coresight/coresight-etm4x.h drivers/hwtracing/coresight/coresight-tmc-etr.c drivers/i2c/busses/i2c-qcom-geni.c drivers/md/dm-crypt.c drivers/md/dm-table.c drivers/md/dm-verity-target.c drivers/media/platform/msm/sde/rotator/sde_rotator_sync.c drivers/media/platform/msm/synx/synx.c drivers/media/platform/msm/synx/synx_debugfs.c drivers/media/platform/msm/synx/synx_util.c drivers/misc/Kconfig drivers/misc/Makefile drivers/misc/qseecom.c drivers/mmc/core/Kconfig drivers/mmc/core/block.c drivers/mmc/host/cqhci-crypto-qti.c drivers/mmc/host/sdhci-msm.c drivers/mmc/host/sdhci.c drivers/net/Kconfig drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c drivers/net/wireguard/Makefile drivers/net/wireguard/allowedips.c drivers/net/wireguard/allowedips.h drivers/net/wireguard/device.c drivers/net/wireguard/device.h drivers/net/wireguard/main.c drivers/net/wireguard/peer.c drivers/net/wireguard/peer.h drivers/net/wireguard/queueing.c drivers/net/wireguard/queueing.h drivers/net/wireguard/ratelimiter.c drivers/net/wireguard/receive.c drivers/net/wireguard/selftest/allowedips.c drivers/net/wireguard/send.c drivers/net/wireguard/socket.c drivers/net/wireless/cnss2/pci.c drivers/net/wireless/mac80211_hwsim.c drivers/of/platform.c drivers/of/property.c drivers/pinctrl/qcom/pinctrl-khaje.c drivers/platform/msm/ipa/ipa_v3/ipa.c drivers/platform/msm/ipa/ipa_v3/ipa_client.c drivers/platform/msm/ipa/ipa_v3/ipa_qmi_service.c drivers/power/supply/power_supply_sysfs.c drivers/power/supply/qcom/Makefile drivers/power/supply/qcom/qg-reg.h drivers/power/supply/qcom/qpnp-qg.c drivers/power/supply/qcom/qpnp-smb5.c drivers/power/supply/qcom/smb1398-charger.c drivers/power/supply/qcom/smb5-lib.c drivers/scsi/ufs/ufshcd-crypto.c drivers/soc/qcom/crypto-qti-tz.c drivers/soc/qcom/icnss2/qmi.c drivers/soc/qcom/icnss_private.h drivers/soc/qcom/qmi_rmnet.c drivers/soc/qcom/qmi_rmnet_i.h drivers/soc/qcom/smcinvoke.c drivers/soc/qcom/socinfo.c drivers/soc/qcom/subsys-pil-tz.c drivers/spi/spi-geni-qcom.c drivers/staging/android/ion/ion.c drivers/tty/serial/msm_geni_serial.c drivers/usb/dwc3/dwc3-msm.c drivers/usb/dwc3/gadget.c drivers/usb/dwc3/gadget.h drivers/usb/gadget/composite.c drivers/usb/gadget/function/f_fs.c drivers/usb/gadget/function/f_hid.c drivers/usb/gadget/function/f_uac1.c drivers/usb/misc/ssusb-redriver-nb7vpq904m.c drivers/usb/musb/Kconfig drivers/usb/musb/mediatek.c drivers/usb/pd/policy_engine.c drivers/usb/phy/phy-msm-qusb.c drivers/usb/typec/bus.c drivers/usb/typec/mux.c drivers/video/fbdev/msm/mdss_sync.c fs/crypto/fscrypt_private.h fs/crypto/inline_crypt.c fs/crypto/keysetup.c fs/crypto/policy.c fs/ext4/dir.c fs/ext4/ext4.h fs/ext4/hash.c fs/ext4/namei.c fs/ext4/page-io.c fs/f2fs/super.c fs/incfs/data_mgmt.h fs/incfs/main.c fs/incfs/vfs.c include/crypto/blake2s.h include/crypto/chacha.h include/crypto/internal/blake2s.h include/crypto/internal/poly1305.h include/crypto/poly1305.h include/drm/drm_mipi_dsi.h include/linux/android_kabi.h include/linux/bits.h include/linux/diagchar.h include/linux/dma-buf.h include/linux/icmpv6.h include/linux/ipv6.h include/linux/page-flags-layout.h include/linux/power_supply.h include/linux/random.h include/linux/sched.h include/linux/usb/gadget.h include/net/icmp.h include/net/ndisc.h include/net/sock.h include/soc/qcom/icnss.h include/soc/qcom/socinfo.h include/trace/events/f2fs.h include/trace/events/random.h include/uapi/linux/android/binderfs.h include/uapi/linux/v4l2-controls.h include/uapi/linux/virtio_ids.h include/uapi/media/msm_camsensor_sdk.h include/uapi/media/msm_media_info.h include/vdso/bits.h include/vdso/datapage.h kernel/bpf/helpers.c kernel/cgroup/cgroup.c kernel/fork.c kernel/futex.c kernel/panic.c kernel/power/wakelock.c kernel/sched/core.c kernel/sched/cpufreq_schedutil.c kernel/sched/sched.h kernel/sched/topology.c kernel/sched/walt.h kernel/time/vsyscall.c lib/Kconfig.kasan lib/crypto/Kconfig lib/crypto/Makefile lib/crypto/blake2s-generic.c lib/crypto/blake2s-selftest.c lib/crypto/blake2s.c lib/crypto/poly1305-donna32.c lib/crypto/poly1305-donna64.c lib/crypto/poly1305.c lib/strnlen_user.c lib/test_meminit.c lib/test_stackinit.c mm/kasan/common.c mm/page_alloc.c mm/page_io.c net/core/filter.c net/ipv4/icmp.c net/ipv6/ip6_icmp.c net/sctp/input.c net/unix/scm.c net/wireless/core.c net/xfrm/xfrm_compat.c net/xfrm/xfrm_state.c net/xfrm/xfrm_user.c scripts/adjust_autoksyms.sh scripts/generate_initcall_order.pl scripts/setlocalversion scripts/tools-support-relr.sh security/Kconfig.hardening security/selinux/hooks.c security/selinux/include/classmap.h security/selinux/include/security.h security/selinux/nlmsgtab.c security/selinux/ss/mls.c security/selinux/ss/policydb.c security/selinux/ss/policydb.h security/selinux/ss/services.c tools/testing/selftests/wireguard/netns.sh tools/testing/selftests/wireguard/qemu/kernel.config Change-Id: I5992ee11f94595fd75ea4cf60b15fe7eee0f28ad
2023-04-15 18:29:19 +02:00
ret = bdev_read_page(sis->bdev, map_swap_page(page, &sis->bdev),
page);
if (!ret) {
count_vm_event(PSWPIN);
goto out;
}
}
ret = 0;
bio = get_swap_bio(GFP_KERNEL, page, end_swap_bio_read);
if (bio == NULL) {
unlock_page(page);
ret = -ENOMEM;
goto out;
}
disk = bio->bi_disk;
mm/page_io.c: fix oops during block io poll in swapin path When a thread is OOM-killed during swap_readpage() operation, an oops occurs because end_swap_bio_read() is calling wake_up_process() based on an assumption that the thread which called swap_readpage() is still alive. Out of memory: Kill process 525 (polkitd) score 0 or sacrifice child Killed process 525 (polkitd) total-vm:528128kB, anon-rss:0kB, file-rss:4kB, shmem-rss:0kB oom_reaper: reaped process 525 (polkitd), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC Modules linked in: nf_conntrack_netbios_ns nf_conntrack_broadcast ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter coretemp ppdev pcspkr vmw_balloon sg shpchp vmw_vmci parport_pc parport i2c_piix4 ip_tables xfs libcrc32c sd_mod sr_mod cdrom ata_generic pata_acpi vmwgfx ahci libahci drm_kms_helper ata_piix syscopyarea sysfillrect sysimgblt fb_sys_fops mptspi scsi_transport_spi ttm e1000 mptscsih drm mptbase i2c_core libata serio_raw CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.13.0-rc2-next-20170725 #129 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 task: ffffffffb7c16500 task.stack: ffffffffb7c00000 RIP: 0010:__lock_acquire+0x151/0x12f0 Call Trace: <IRQ> lock_acquire+0x59/0x80 _raw_spin_lock_irqsave+0x3b/0x4f try_to_wake_up+0x3b/0x410 wake_up_process+0x10/0x20 end_swap_bio_read+0x6f/0xf0 bio_endio+0x92/0xb0 blk_update_request+0x88/0x270 scsi_end_request+0x32/0x1c0 scsi_io_completion+0x209/0x680 scsi_finish_command+0xd4/0x120 scsi_softirq_done+0x120/0x140 __blk_mq_complete_request_remote+0xe/0x10 flush_smp_call_function_queue+0x51/0x120 generic_smp_call_function_single_interrupt+0xe/0x20 smp_trace_call_function_single_interrupt+0x22/0x30 smp_call_function_single_interrupt+0x9/0x10 call_function_single_interrupt+0xa7/0xb0 </IRQ> RIP: 0010:native_safe_halt+0x6/0x10 default_idle+0xe/0x20 arch_cpu_idle+0xa/0x10 default_idle_call+0x1e/0x30 do_idle+0x187/0x200 cpu_startup_entry+0x6e/0x70 rest_init+0xd0/0xe0 start_kernel+0x456/0x477 x86_64_start_reservations+0x24/0x26 x86_64_start_kernel+0xf7/0x11a secondary_startup_64+0xa5/0xa5 Code: c3 49 81 3f 20 9e 0b b8 41 bc 00 00 00 00 44 0f 45 e2 83 fe 01 0f 87 62 ff ff ff 89 f0 49 8b 44 c7 08 48 85 c0 0f 84 52 ff ff ff <f0> ff 80 98 01 00 00 8b 3d 5a 49 c4 01 45 8b b3 18 0c 00 00 85 RIP: __lock_acquire+0x151/0x12f0 RSP: ffffa01f39e03c50 ---[ end trace 6c441db499169b1e ]--- Kernel panic - not syncing: Fatal exception in interrupt Kernel Offset: 0x36000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) ---[ end Kernel panic - not syncing: Fatal exception in interrupt Fix it by holding a reference to the thread. [akpm@linux-foundation.org: add comment] Fixes: 23955622ff8d231b ("swap: add block io poll in swapin path") Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reviewed-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-08-02 22:32:09 +02:00
/*
* Keep this task valid during swap readpage because the oom killer may
* attempt to access it in the page fault retry time check.
*/
get_task_struct(current);
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
bio->bi_private = current;
bio_set_op_attrs(bio, REQ_OP_READ, 0);
[PATCH] Light weight event counters The remaining counters in page_state after the zoned VM counter patches have been applied are all just for show in /proc/vmstat. They have no essential function for the VM. We use a simple increment of per cpu variables. In order to avoid the most severe races we disable preempt. Preempt does not prevent the race between an increment and an interrupt handler incrementing the same statistics counter. However, that race is exceedingly rare, we may only loose one increment or so and there is no requirement (at least not in kernel) that the vm event counters have to be accurate. In the non preempt case this results in a simple increment for each counter. For many architectures this will be reduced by the compiler to a single instruction. This single instruction is atomic for i386 and x86_64. And therefore even the rare race condition in an interrupt is avoided for both architectures in most cases. The patchset also adds an off switch for embedded systems that allows a building of linux kernels without these counters. The implementation of these counters is through inline code that hopefully results in only a single instruction increment instruction being emitted (i386, x86_64) or in the increment being hidden though instruction concurrency (EPIC architectures such as ia64 can get that done). Benefits: - VM event counter operations usually reduce to a single inline instruction on i386 and x86_64. - No interrupt disable, only preempt disable for the preempt case. Preempt disable can also be avoided by moving the counter into a spinlock. - Handling is similar to zoned VM counters. - Simple and easily extendable. - Can be omitted to reduce memory use for embedded use. References: RFC http://marc.theaimsgroup.com/?l=linux-kernel&m=113512330605497&w=2 RFC http://marc.theaimsgroup.com/?l=linux-kernel&m=114988082814934&w=2 local_t http://marc.theaimsgroup.com/?l=linux-kernel&m=114991748606690&w=2 V2 http://marc.theaimsgroup.com/?t=115014808400007&r=1&w=2 V3 http://marc.theaimsgroup.com/?l=linux-kernel&m=115024767022346&w=2 V4 http://marc.theaimsgroup.com/?l=linux-kernel&m=115047968808926&w=2 Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-30 10:55:45 +02:00
count_vm_event(PSWPIN);
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
bio_get(bio);
qc = submit_bio(bio);
while (synchronous) {
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
set_current_state(TASK_UNINTERRUPTIBLE);
if (!READ_ONCE(bio->bi_private))
break;
if (!blk_poll(disk->queue, qc))
swap: add block io poll in swapin path For fast flash disk, async IO could introduce overhead because of context switch. block-mq now supports IO poll, which improves performance and latency a lot. swapin is a good place to use this technique, because the task is waiting for the swapin page to continue execution. In my virtual machine, directly read 4k data from a NVMe with iopoll is about 60% better than that without poll. With iopoll support in swapin patch, my microbenchmark (a task does random memory write) is about 10%~25% faster. CPU utilization increases a lot though, 2x and even 3x CPU utilization. This will depend on disk speed. While iopoll in swapin isn't intended for all usage cases, it's a win for latency sensistive workloads with high speed swap disk. block layer has knob to control poll in runtime. If poll isn't enabled in block layer, there should be no noticeable change in swapin. I got a chance to run the same test in a NVMe with DRAM as the media. In simple fio IO test, blkpoll boosts 50% performance in single thread test and ~20% in 8 threads test. So this is the base line. In above swap test, blkpoll boosts ~27% performance in single thread test. blkpoll uses 2x CPU time though. If we enable hybid polling, the performance gain has very slight drop but CPU time is only 50% worse than that without blkpoll. Also we can adjust parameter of hybid poll, with it, the CPU time penality is reduced further. In 8 threads test, blkpoll doesn't help though. The performance is similar to that without blkpoll, but cpu utilization is similar too. There is lock contention in swap path. The cpu time spending on blkpoll isn't high. So overall, blkpoll swapin isn't worse than that without it. The swapin readahead might read several pages in in the same time and form a big IO request. Since the IO will take longer time, it doesn't make sense to do poll, so the patch only does iopoll for single page swapin. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/070c3c3e40b711e7b1390002c991e86a-b5408f0@7511894063d3764ff01ea8111f5a004d7dd700ed078797c204a24e620ddb965c Signed-off-by: Shaohua Li <shli@fb.com> Cc: Tim Chen <tim.c.chen@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Jens Axboe <axboe@fb.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-11 00:47:11 +02:00
break;
}
__set_current_state(TASK_RUNNING);
bio_put(bio);
out:
psi_memstall_leave(&pflags);
return ret;
}
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
int swap_set_page_dirty(struct page *page)
{
struct swap_info_struct *sis = page_swap_info(page);
if (sis->flags & SWP_FILE) {
struct address_space *mapping = sis->swap_file->f_mapping;
VM_BUG_ON_PAGE(!PageSwapCache(page), page);
mm: add support for a filesystem to activate swap files and use direct_IO for writing swap pages Currently swapfiles are managed entirely by the core VM by using ->bmap to allocate space and write to the blocks directly. This effectively ensures that the underlying blocks are allocated and avoids the need for the swap subsystem to locate what physical blocks store offsets within a file. If the swap subsystem is to use the filesystem information to locate the blocks, it is critical that information such as block groups, block bitmaps and the block descriptor table that map the swap file were resident in memory. This patch adds address_space_operations that the VM can call when activating or deactivating swap backed by a file. int swap_activate(struct file *); int swap_deactivate(struct file *); The ->swap_activate() method is used to communicate to the file that the VM relies on it, and the address_space should take adequate measures such as reserving space in the underlying device, reserving memory for mempools and pinning information such as the block descriptor table in memory. The ->swap_deactivate() method is called on sys_swapoff() if ->swap_activate() returned success. After a successful swapfile ->swap_activate, the swapfile is marked SWP_FILE and swapper_space.a_ops will proxy to sis->swap_file->f_mappings->a_ops using ->direct_io to write swapcache pages and ->readpage to read. It is perfectly possible that direct_IO be used to read the swap pages but it is an unnecessary complication. Similarly, it is possible that ->writepage be used instead of direct_io to write the pages but filesystem developers have stated that calling writepage from the VM is undesirable for a variety of reasons and using direct_IO opens up the possibility of writing back batches of swap pages in the future. [a.p.zijlstra@chello.nl: Original patch] Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: Eric B Munson <emunson@mgebm.net> Cc: Eric Paris <eparis@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Neil Brown <neilb@suse.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-01 01:44:55 +02:00
return mapping->a_ops->set_page_dirty(page);
} else {
return __set_page_dirty_no_writeback(page);
}
}