Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
"A bunch of fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
slub: mark the dangling ifdef #else of CONFIG_SLUB_DEBUG
slub: avoid irqoff/on in bulk allocation
slub: create new ___slab_alloc function that can be called with irqs disabled
mm: fix up sparse warning in gfpflags_allow_blocking
ocfs2: fix umask ignored issue
PM/OPP: add entry in MAINTAINERS
kernel/panic.c: turn off locks debug before releasing console lock
kernel/signal.c: unexport sigsuspend()
kasan: fix kmemleak false-positive in kasan_module_alloc()
fat: fix fake_offset handling on error path
mm/hugetlbfs: fix bugs in fallocate hole punch of areas with holes
mm/page-writeback.c: initialize m_dirty to avoid compile warning
various: fix pci_set_dma_mask return value checking
mm: loosen MADV_NOHUGEPAGE to enable Qemu postcopy on s390
mm: vmalloc: don't remove inexistent guard hole in remove_vm_area()
tools/vm/page-types.c: support KPF_IDLE
ncpfs: don't allow negative timeouts
configfs: allow dynamic group creation
MAINTAINERS: add Moritz as reviewer for FPGA Manager Framework
slab.h: sprinkle __assume_aligned attributes

+283 -111
+13
MAINTAINERS
··· 4411 4411 4412 4412 FPGA MANAGER FRAMEWORK 4413 4413 M: Alan Tull <atull@opensource.altera.com> 4414 + R: Moritz Fischer <moritz.fischer@ettus.com> 4414 4415 S: Maintained 4415 4416 F: drivers/fpga/ 4416 4417 F: include/linux/fpga/fpga-mgr.h ··· 7904 7903 S: Maintained 7905 7904 F: net/openvswitch/ 7906 7905 F: include/uapi/linux/openvswitch.h 7906 + 7907 + OPERATING PERFORMANCE POINTS (OPP) 7908 + M: Viresh Kumar <vireshk@kernel.org> 7909 + M: Nishanth Menon <nm@ti.com> 7910 + M: Stephen Boyd <sboyd@codeaurora.org> 7911 + L: linux-pm@vger.kernel.org 7912 + S: Maintained 7913 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git 7914 + F: drivers/base/power/opp/ 7915 + F: include/linux/pm_opp.h 7916 + F: Documentation/power/opp.txt 7917 + F: Documentation/devicetree/bindings/opp/ 7907 7918 7908 7919 OPL4 DRIVER 7909 7920 M: Clemens Ladisch <clemens@ladisch.de>
+2 -2
drivers/media/pci/cx23885/cx23885-core.c
··· 1992 1992 (unsigned long long)pci_resource_start(pci_dev, 0)); 1993 1993 1994 1994 pci_set_master(pci_dev); 1995 - if (!pci_set_dma_mask(pci_dev, 0xffffffff)) { 1995 + err = pci_set_dma_mask(pci_dev, 0xffffffff); 1996 + if (err) { 1996 1997 printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); 1997 - err = -EIO; 1998 1998 goto fail_context; 1999 1999 } 2000 2000
+2 -1
drivers/media/pci/cx25821/cx25821-core.c
··· 1319 1319 dev->pci_lat, (unsigned long long)dev->base_io_addr); 1320 1320 1321 1321 pci_set_master(pci_dev); 1322 - if (!pci_set_dma_mask(pci_dev, 0xffffffff)) { 1322 + err = pci_set_dma_mask(pci_dev, 0xffffffff); 1323 + if (err) { 1323 1324 pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); 1324 1325 err = -EIO; 1325 1326 goto fail_irq;
+2 -2
drivers/media/pci/cx88/cx88-alsa.c
··· 890 890 return err; 891 891 } 892 892 893 - if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) { 893 + err = pci_set_dma_mask(pci,DMA_BIT_MASK(32)); 894 + if (err) { 894 895 dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name); 895 - err = -EIO; 896 896 cx88_core_put(core, pci); 897 897 return err; 898 898 }
+2 -1
drivers/media/pci/cx88/cx88-mpeg.c
··· 393 393 if (pci_enable_device(dev->pci)) 394 394 return -EIO; 395 395 pci_set_master(dev->pci); 396 - if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) { 396 + err = pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32)); 397 + if (err) { 397 398 printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name); 398 399 return -EIO; 399 400 }
+2 -2
drivers/media/pci/cx88/cx88-video.c
··· 1314 1314 dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0)); 1315 1315 1316 1316 pci_set_master(pci_dev); 1317 - if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) { 1317 + err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32)); 1318 + if (err) { 1318 1319 printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name); 1319 - err = -EIO; 1320 1320 goto fail_core; 1321 1321 } 1322 1322 dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev);
+1 -1
drivers/media/pci/netup_unidvb/netup_unidvb_core.c
··· 810 810 "%s(): board vendor 0x%x, revision 0x%x\n", 811 811 __func__, board_vendor, board_revision); 812 812 pci_set_master(pci_dev); 813 - if (!pci_set_dma_mask(pci_dev, 0xffffffff)) { 813 + if (pci_set_dma_mask(pci_dev, 0xffffffff) < 0) { 814 814 dev_err(&pci_dev->dev, 815 815 "%s(): 32bit PCI DMA is not supported\n", __func__); 816 816 goto pci_detect_err;
+2 -2
drivers/media/pci/saa7134/saa7134-core.c
··· 951 951 pci_name(pci_dev), dev->pci_rev, pci_dev->irq, 952 952 dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0)); 953 953 pci_set_master(pci_dev); 954 - if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) { 954 + err = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32)); 955 + if (err) { 955 956 pr_warn("%s: Oops: no 32bit PCI DMA ???\n", dev->name); 956 - err = -EIO; 957 957 goto fail1; 958 958 } 959 959
+2 -2
drivers/media/pci/saa7164/saa7164-core.c
··· 1264 1264 1265 1265 pci_set_master(pci_dev); 1266 1266 /* TODO */ 1267 - if (!pci_set_dma_mask(pci_dev, 0xffffffff)) { 1267 + err = pci_set_dma_mask(pci_dev, 0xffffffff); 1268 + if (err) { 1268 1269 printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); 1269 - err = -EIO; 1270 1270 goto fail_irq; 1271 1271 } 1272 1272
+2 -2
drivers/media/pci/tw68/tw68-core.c
··· 257 257 dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq, 258 258 dev->pci_lat, (u64)pci_resource_start(pci_dev, 0)); 259 259 pci_set_master(pci_dev); 260 - if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) { 260 + err = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32)); 261 + if (err) { 261 262 pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name); 262 - err = -EIO; 263 263 goto fail1; 264 264 } 265 265
+3 -2
drivers/net/ethernet/amd/pcnet32.c
··· 1500 1500 return -ENODEV; 1501 1501 } 1502 1502 1503 - if (!pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) { 1503 + err = pci_set_dma_mask(pdev, PCNET32_DMA_MASK); 1504 + if (err) { 1504 1505 if (pcnet32_debug & NETIF_MSG_PROBE) 1505 1506 pr_err("architecture does not support 32bit PCI busmaster DMA\n"); 1506 - return -ENODEV; 1507 + return err; 1507 1508 } 1508 1509 if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) { 1509 1510 if (pcnet32_debug & NETIF_MSG_PROBE)
+110
fs/configfs/dir.c
··· 1636 1636 .iterate = configfs_readdir, 1637 1637 }; 1638 1638 1639 + /** 1640 + * configfs_register_group - creates a parent-child relation between two groups 1641 + * @parent_group: parent group 1642 + * @group: child group 1643 + * 1644 + * link groups, creates dentry for the child and attaches it to the 1645 + * parent dentry. 1646 + * 1647 + * Return: 0 on success, negative errno code on error 1648 + */ 1649 + int configfs_register_group(struct config_group *parent_group, 1650 + struct config_group *group) 1651 + { 1652 + struct configfs_subsystem *subsys = parent_group->cg_subsys; 1653 + struct dentry *parent; 1654 + int ret; 1655 + 1656 + mutex_lock(&subsys->su_mutex); 1657 + link_group(parent_group, group); 1658 + mutex_unlock(&subsys->su_mutex); 1659 + 1660 + parent = parent_group->cg_item.ci_dentry; 1661 + 1662 + mutex_lock_nested(&d_inode(parent)->i_mutex, I_MUTEX_PARENT); 1663 + ret = create_default_group(parent_group, group); 1664 + if (!ret) { 1665 + spin_lock(&configfs_dirent_lock); 1666 + configfs_dir_set_ready(group->cg_item.ci_dentry->d_fsdata); 1667 + spin_unlock(&configfs_dirent_lock); 1668 + } 1669 + mutex_unlock(&d_inode(parent)->i_mutex); 1670 + return ret; 1671 + } 1672 + EXPORT_SYMBOL(configfs_register_group); 1673 + 1674 + /** 1675 + * configfs_unregister_group() - unregisters a child group from its parent 1676 + * @group: parent group to be unregistered 1677 + * 1678 + * Undoes configfs_register_group() 1679 + */ 1680 + void configfs_unregister_group(struct config_group *group) 1681 + { 1682 + struct configfs_subsystem *subsys = group->cg_subsys; 1683 + struct dentry *dentry = group->cg_item.ci_dentry; 1684 + struct dentry *parent = group->cg_item.ci_parent->ci_dentry; 1685 + 1686 + mutex_lock_nested(&d_inode(parent)->i_mutex, I_MUTEX_PARENT); 1687 + spin_lock(&configfs_dirent_lock); 1688 + configfs_detach_prep(dentry, NULL); 1689 + spin_unlock(&configfs_dirent_lock); 1690 + 1691 + configfs_detach_group(&group->cg_item); 1692 + d_inode(dentry)->i_flags |= S_DEAD; 1693 + dont_mount(dentry); 1694 + d_delete(dentry); 1695 + mutex_unlock(&d_inode(parent)->i_mutex); 1696 + 1697 + dput(dentry); 1698 + 1699 + mutex_lock(&subsys->su_mutex); 1700 + unlink_group(group); 1701 + mutex_unlock(&subsys->su_mutex); 1702 + } 1703 + EXPORT_SYMBOL(configfs_unregister_group); 1704 + 1705 + /** 1706 + * configfs_register_default_group() - allocates and registers a child group 1707 + * @parent_group: parent group 1708 + * @name: child group name 1709 + * @item_type: child item type description 1710 + * 1711 + * boilerplate to allocate and register a child group with its parent. We need 1712 + * kzalloc'ed memory because child's default_group is initially empty. 1713 + * 1714 + * Return: allocated config group or ERR_PTR() on error 1715 + */ 1716 + struct config_group * 1717 + configfs_register_default_group(struct config_group *parent_group, 1718 + const char *name, 1719 + struct config_item_type *item_type) 1720 + { 1721 + int ret; 1722 + struct config_group *group; 1723 + 1724 + group = kzalloc(sizeof(*group), GFP_KERNEL); 1725 + if (!group) 1726 + return ERR_PTR(-ENOMEM); 1727 + config_group_init_type_name(group, name, item_type); 1728 + 1729 + ret = configfs_register_group(parent_group, group); 1730 + if (ret) { 1731 + kfree(group); 1732 + return ERR_PTR(ret); 1733 + } 1734 + return group; 1735 + } 1736 + EXPORT_SYMBOL(configfs_register_default_group); 1737 + 1738 + /** 1739 + * configfs_unregister_default_group() - unregisters and frees a child group 1740 + * @group: the group to act on 1741 + */ 1742 + void configfs_unregister_default_group(struct config_group *group) 1743 + { 1744 + configfs_unregister_group(group); 1745 + kfree(group); 1746 + } 1747 + EXPORT_SYMBOL(configfs_unregister_default_group); 1748 + 1639 1749 int configfs_register_subsystem(struct configfs_subsystem *subsys) 1640 1750 { 1641 1751 int err;
+11 -5
fs/fat/dir.c
··· 610 610 int status = fat_parse_long(inode, &cpos, &bh, &de, 611 611 &unicode, &nr_slots); 612 612 if (status < 0) { 613 - ctx->pos = cpos; 613 + bh = NULL; 614 614 ret = status; 615 - goto out; 615 + goto end_of_dir; 616 616 } else if (status == PARSE_INVALID) 617 617 goto record_end; 618 618 else if (status == PARSE_NOT_LONGNAME) ··· 654 654 fill_len = short_len; 655 655 656 656 start_filldir: 657 - if (!fake_offset) 658 - ctx->pos = cpos - (nr_slots + 1) * sizeof(struct msdos_dir_entry); 657 + ctx->pos = cpos - (nr_slots + 1) * sizeof(struct msdos_dir_entry); 658 + if (fake_offset && ctx->pos < 2) 659 + ctx->pos = 2; 659 660 660 661 if (!memcmp(de->name, MSDOS_DOT, MSDOS_NAME)) { 661 662 if (!dir_emit_dot(file, ctx)) ··· 682 681 fake_offset = 0; 683 682 ctx->pos = cpos; 684 683 goto get_new; 684 + 685 685 end_of_dir: 686 - ctx->pos = cpos; 686 + if (fake_offset && cpos < 2) 687 + ctx->pos = 2; 688 + else 689 + ctx->pos = cpos; 687 690 fill_failed: 688 691 brelse(bh); 689 692 if (unicode) 690 693 __putname(unicode); 691 694 out: 692 695 mutex_unlock(&sbi->s_lock); 696 + 693 697 return ret; 694 698 } 695 699
+32 -33
fs/hugetlbfs/inode.c
··· 332 332 * truncation is indicated by end of range being LLONG_MAX 333 333 * In this case, we first scan the range and release found pages. 334 334 * After releasing pages, hugetlb_unreserve_pages cleans up region/reserv 335 - * maps and global counts. 335 + * maps and global counts. Page faults can not race with truncation 336 + * in this routine. hugetlb_no_page() prevents page faults in the 337 + * truncated range. It checks i_size before allocation, and again after 338 + * with the page table lock for the page held. The same lock must be 339 + * acquired to unmap a page. 336 340 * hole punch is indicated if end is not LLONG_MAX 337 341 * In the hole punch case we scan the range and release found pages. 338 342 * Only when releasing a page is the associated region/reserv map 339 343 * deleted. The region/reserv map for ranges without associated 340 - * pages are not modified. 344 + * pages are not modified. Page faults can race with hole punch. 345 + * This is indicated if we find a mapped page. 341 346 * Note: If the passed end of range value is beyond the end of file, but 342 347 * not LLONG_MAX this routine still performs a hole punch operation. 343 348 */ ··· 366 361 next = start; 367 362 while (next < end) { 368 363 /* 369 - * Make sure to never grab more pages that we 370 - * might possibly need. 364 + * Don't grab more pages than the number left in the range. 371 365 */ 372 366 if (end - next < lookup_nr) 373 367 lookup_nr = end - next; 374 368 375 369 /* 376 - * This pagevec_lookup() may return pages past 'end', 377 - * so we must check for page->index > end. 370 + * When no more pages are found, we are done. 378 371 */ 379 - if (!pagevec_lookup(&pvec, mapping, next, lookup_nr)) { 380 - if (next == start) 381 - break; 382 - next = start; 383 - continue; 384 - } 372 + if (!pagevec_lookup(&pvec, mapping, next, lookup_nr)) 373 + break; 385 374 386 375 for (i = 0; i < pagevec_count(&pvec); ++i) { 387 376 struct page *page = pvec.pages[i]; 388 377 u32 hash; 378 + 379 + /* 380 + * The page (index) could be beyond end. This is 381 + * only possible in the punch hole case as end is 382 + * max page offset in the truncate case. 383 + */ 384 + next = page->index; 385 + if (next >= end) 386 + break; 389 387 390 388 hash = hugetlb_fault_mutex_hash(h, current->mm, 391 389 &pseudo_vma, ··· 396 388 mutex_lock(&hugetlb_fault_mutex_table[hash]); 397 389 398 390 lock_page(page); 399 - if (page->index >= end) { 400 - unlock_page(page); 401 - mutex_unlock(&hugetlb_fault_mutex_table[hash]); 402 - next = end; /* we are done */ 403 - break; 404 - } 405 - 406 - /* 407 - * If page is mapped, it was faulted in after being 408 - * unmapped. Do nothing in this race case. In the 409 - * normal case page is not mapped. 410 - */ 411 - if (!page_mapped(page)) { 391 + if (likely(!page_mapped(page))) { 412 392 bool rsv_on_error = !PagePrivate(page); 413 393 /* 414 394 * We must free the huge page and remove ··· 417 421 hugetlb_fix_reserve_counts( 418 422 inode, rsv_on_error); 419 423 } 424 + } else { 425 + /* 426 + * If page is mapped, it was faulted in after 427 + * being unmapped. It indicates a race between 428 + * hole punch and page fault. Do nothing in 429 + * this case. Getting here in a truncate 430 + * operation is a bug. 431 + */ 432 + BUG_ON(truncate_op); 420 433 } 421 434 422 - if (page->index > next) 423 - next = page->index; 424 - 425 - ++next; 426 435 unlock_page(page); 427 - 428 436 mutex_unlock(&hugetlb_fault_mutex_table[hash]); 429 437 } 438 + ++next; 430 439 huge_pagevec_release(&pvec); 440 + cond_resched(); 431 441 } 432 442 433 443 if (truncate_op) ··· 649 647 if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) 650 648 i_size_write(inode, offset + len); 651 649 inode->i_ctime = CURRENT_TIME; 652 - spin_lock(&inode->i_lock); 653 - inode->i_private = NULL; 654 - spin_unlock(&inode->i_lock); 655 650 out: 656 651 mutex_unlock(&inode->i_mutex); 657 652 return error;
+2
fs/ncpfs/ioctl.c
··· 525 525 switch (rqdata.cmd) { 526 526 case NCP_LOCK_EX: 527 527 case NCP_LOCK_SH: 528 + if (rqdata.timeout < 0) 529 + return -EINVAL; 528 530 if (rqdata.timeout == 0) 529 531 rqdata.timeout = NCP_LOCK_DEFAULT_TIMEOUT; 530 532 else if (rqdata.timeout > NCP_LOCK_MAX_TIMEOUT)
+2
fs/ocfs2/namei.c
··· 372 372 mlog_errno(status); 373 373 goto leave; 374 374 } 375 + /* update inode->i_mode after mask with "umask". */ 376 + inode->i_mode = mode; 375 377 376 378 handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, 377 379 S_ISDIR(mode),
+10
include/linux/configfs.h
··· 197 197 int configfs_register_subsystem(struct configfs_subsystem *subsys); 198 198 void configfs_unregister_subsystem(struct configfs_subsystem *subsys); 199 199 200 + int configfs_register_group(struct config_group *parent_group, 201 + struct config_group *group); 202 + void configfs_unregister_group(struct config_group *group); 203 + 204 + struct config_group * 205 + configfs_register_default_group(struct config_group *parent_group, 206 + const char *name, 207 + struct config_item_type *item_type); 208 + void configfs_unregister_default_group(struct config_group *group); 209 + 200 210 /* These functions can sleep and can alloc with GFP_KERNEL */ 201 211 /* WARNING: These cannot be called underneath configfs callbacks!! */ 202 212 int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target);
+1 -1
include/linux/gfp.h
··· 271 271 272 272 static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags) 273 273 { 274 - return gfp_flags & __GFP_DIRECT_RECLAIM; 274 + return (bool __force)(gfp_flags & __GFP_DIRECT_RECLAIM); 275 275 } 276 276 277 277 #ifdef CONFIG_HIGHMEM
-1
include/linux/signal.h
··· 239 239 extern void set_current_blocked(sigset_t *); 240 240 extern void __set_current_blocked(const sigset_t *); 241 241 extern int show_unhandled_signals; 242 - extern int sigsuspend(sigset_t *); 243 242 244 243 struct sigaction { 245 244 #ifndef __ARCH_HAS_IRIX_SIGACTION
+26 -17
include/linux/slab.h
··· 158 158 #endif 159 159 160 160 /* 161 + * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment. 162 + * Intended for arches that get misalignment faults even for 64 bit integer 163 + * aligned buffers. 164 + */ 165 + #ifndef ARCH_SLAB_MINALIGN 166 + #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) 167 + #endif 168 + 169 + /* 170 + * kmalloc and friends return ARCH_KMALLOC_MINALIGN aligned 171 + * pointers. kmem_cache_alloc and friends return ARCH_SLAB_MINALIGN 172 + * aligned pointers. 173 + */ 174 + #define __assume_kmalloc_alignment __assume_aligned(ARCH_KMALLOC_MINALIGN) 175 + #define __assume_slab_alignment __assume_aligned(ARCH_SLAB_MINALIGN) 176 + #define __assume_page_alignment __assume_aligned(PAGE_SIZE) 177 + 178 + /* 161 179 * Kmalloc array related definitions 162 180 */ 163 181 ··· 304 286 } 305 287 #endif /* !CONFIG_SLOB */ 306 288 307 - void *__kmalloc(size_t size, gfp_t flags); 308 - void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags); 289 + void *__kmalloc(size_t size, gfp_t flags) __assume_kmalloc_alignment; 290 + void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags) __assume_slab_alignment; 309 291 void kmem_cache_free(struct kmem_cache *, void *); 310 292 311 293 /* ··· 319 301 bool kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **); 320 302 321 303 #ifdef CONFIG_NUMA 322 - void *__kmalloc_node(size_t size, gfp_t flags, int node); 323 - void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 304 + void *__kmalloc_node(size_t size, gfp_t flags, int node) __assume_kmalloc_alignment; 305 + void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node) __assume_slab_alignment; 324 306 #else 325 307 static __always_inline void *__kmalloc_node(size_t size, gfp_t flags, int node) 326 308 { ··· 334 316 #endif 335 317 336 318 #ifdef CONFIG_TRACING 337 - extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t); 319 + extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t) __assume_slab_alignment; 338 320 339 321 #ifdef CONFIG_NUMA 340 322 extern void *kmem_cache_alloc_node_trace(struct kmem_cache *s, 341 323 gfp_t gfpflags, 342 - int node, size_t size); 324 + int node, size_t size) __assume_slab_alignment; 343 325 #else 344 326 static __always_inline void * 345 327 kmem_cache_alloc_node_trace(struct kmem_cache *s, ··· 372 354 } 373 355 #endif /* CONFIG_TRACING */ 374 356 375 - extern void *kmalloc_order(size_t size, gfp_t flags, unsigned int order); 357 + extern void *kmalloc_order(size_t size, gfp_t flags, unsigned int order) __assume_page_alignment; 376 358 377 359 #ifdef CONFIG_TRACING 378 - extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order); 360 + extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order) __assume_page_alignment; 379 361 #else 380 362 static __always_inline void * 381 363 kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order) ··· 499 481 #endif 500 482 return __kmalloc_node(size, flags, node); 501 483 } 502 - 503 - /* 504 - * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment. 505 - * Intended for arches that get misalignment faults even for 64 bit integer 506 - * aligned buffers. 507 - */ 508 - #ifndef ARCH_SLAB_MINALIGN 509 - #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) 510 - #endif 511 484 512 485 struct memcg_cache_array { 513 486 struct rcu_head rcu;
+4 -1
kernel/panic.c
··· 152 152 * We may have ended up stopping the CPU holding the lock (in 153 153 * smp_send_stop()) while still having some valuable data in the console 154 154 * buffer. Try to acquire the lock then release it regardless of the 155 - * result. The release will also print the buffers out. 155 + * result. The release will also print the buffers out. Locks debug 156 + * should be disabled to avoid reporting bad unlock balance when 157 + * panic() is not being callled from OOPS. 156 158 */ 159 + debug_locks_off(); 157 160 console_trylock(); 158 161 console_unlock(); 159 162
+1 -1
kernel/signal.c
··· 3503 3503 3504 3504 #endif 3505 3505 3506 - int sigsuspend(sigset_t *set) 3506 + static int sigsuspend(sigset_t *set) 3507 3507 { 3508 3508 current->saved_sigmask = current->blocked; 3509 3509 set_current_blocked(set);
+2 -2
mm/huge_memory.c
··· 2009 2009 /* 2010 2010 * Be somewhat over-protective like KSM for now! 2011 2011 */ 2012 - if (*vm_flags & (VM_HUGEPAGE | VM_NO_THP)) 2012 + if (*vm_flags & VM_NO_THP) 2013 2013 return -EINVAL; 2014 2014 *vm_flags &= ~VM_NOHUGEPAGE; 2015 2015 *vm_flags |= VM_HUGEPAGE; ··· 2025 2025 /* 2026 2026 * Be somewhat over-protective like KSM for now! 2027 2027 */ 2028 - if (*vm_flags & (VM_NOHUGEPAGE | VM_NO_THP)) 2028 + if (*vm_flags & VM_NO_THP) 2029 2029 return -EINVAL; 2030 2030 *vm_flags &= ~VM_HUGEPAGE; 2031 2031 *vm_flags |= VM_NOHUGEPAGE;
+2
mm/kasan/kasan.c
··· 19 19 #include <linux/export.h> 20 20 #include <linux/init.h> 21 21 #include <linux/kernel.h> 22 + #include <linux/kmemleak.h> 22 23 #include <linux/memblock.h> 23 24 #include <linux/memory.h> 24 25 #include <linux/mm.h> ··· 445 444 446 445 if (ret) { 447 446 find_vm_area(addr)->flags |= VM_KASAN; 447 + kmemleak_ignore(ret); 448 448 return 0; 449 449 } 450 450
+3 -1
mm/page-writeback.c
··· 1542 1542 for (;;) { 1543 1543 unsigned long now = jiffies; 1544 1544 unsigned long dirty, thresh, bg_thresh; 1545 - unsigned long m_dirty, m_thresh, m_bg_thresh; 1545 + unsigned long m_dirty = 0; /* stop bogus uninit warnings */ 1546 + unsigned long m_thresh = 0; 1547 + unsigned long m_bg_thresh = 0; 1546 1548 1547 1549 /* 1548 1550 * Unstable writes are a feature of certain networked
+41 -29
mm/slub.c
··· 1204 1204 1205 1205 return flags; 1206 1206 } 1207 - #else 1207 + #else /* !CONFIG_SLUB_DEBUG */ 1208 1208 static inline void setup_object_debug(struct kmem_cache *s, 1209 1209 struct page *page, void *object) {} 1210 1210 ··· 2295 2295 * And if we were unable to get a new slab from the partial slab lists then 2296 2296 * we need to allocate a new slab. This is the slowest path since it involves 2297 2297 * a call to the page allocator and the setup of a new slab. 2298 + * 2299 + * Version of __slab_alloc to use when we know that interrupts are 2300 + * already disabled (which is the case for bulk allocation). 2298 2301 */ 2299 - static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, 2302 + static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, 2300 2303 unsigned long addr, struct kmem_cache_cpu *c) 2301 2304 { 2302 2305 void *freelist; 2303 2306 struct page *page; 2304 - unsigned long flags; 2305 - 2306 - local_irq_save(flags); 2307 - #ifdef CONFIG_PREEMPT 2308 - /* 2309 - * We may have been preempted and rescheduled on a different 2310 - * cpu before disabling interrupts. Need to reload cpu area 2311 - * pointer. 2312 - */ 2313 - c = this_cpu_ptr(s->cpu_slab); 2314 - #endif 2315 2307 2316 2308 page = c->page; 2317 2309 if (!page) ··· 2361 2369 VM_BUG_ON(!c->page->frozen); 2362 2370 c->freelist = get_freepointer(s, freelist); 2363 2371 c->tid = next_tid(c->tid); 2364 - local_irq_restore(flags); 2365 2372 return freelist; 2366 2373 2367 2374 new_slab: ··· 2377 2386 2378 2387 if (unlikely(!freelist)) { 2379 2388 slab_out_of_memory(s, gfpflags, node); 2380 - local_irq_restore(flags); 2381 2389 return NULL; 2382 2390 } 2383 2391 ··· 2392 2402 deactivate_slab(s, page, get_freepointer(s, freelist)); 2393 2403 c->page = NULL; 2394 2404 c->freelist = NULL; 2395 - local_irq_restore(flags); 2396 2405 return freelist; 2406 + } 2407 + 2408 + /* 2409 + * Another one that disabled interrupt and compensates for possible 2410 + * cpu changes by refetching the per cpu area pointer. 2411 + */ 2412 + static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, 2413 + unsigned long addr, struct kmem_cache_cpu *c) 2414 + { 2415 + void *p; 2416 + unsigned long flags; 2417 + 2418 + local_irq_save(flags); 2419 + #ifdef CONFIG_PREEMPT 2420 + /* 2421 + * We may have been preempted and rescheduled on a different 2422 + * cpu before disabling interrupts. Need to reload cpu area 2423 + * pointer. 2424 + */ 2425 + c = this_cpu_ptr(s->cpu_slab); 2426 + #endif 2427 + 2428 + p = ___slab_alloc(s, gfpflags, node, addr, c); 2429 + local_irq_restore(flags); 2430 + return p; 2397 2431 } 2398 2432 2399 2433 /* ··· 2818 2804 void *object = c->freelist; 2819 2805 2820 2806 if (unlikely(!object)) { 2821 - local_irq_enable(); 2822 2807 /* 2823 2808 * Invoking slow path likely have side-effect 2824 2809 * of re-populating per CPU c->freelist 2825 2810 */ 2826 - p[i] = __slab_alloc(s, flags, NUMA_NO_NODE, 2811 + p[i] = ___slab_alloc(s, flags, NUMA_NO_NODE, 2827 2812 _RET_IP_, c); 2828 - if (unlikely(!p[i])) { 2829 - __kmem_cache_free_bulk(s, i, p); 2830 - return false; 2831 - } 2832 - local_irq_disable(); 2813 + if (unlikely(!p[i])) 2814 + goto error; 2815 + 2833 2816 c = this_cpu_ptr(s->cpu_slab); 2834 2817 continue; /* goto for-loop */ 2835 2818 } 2836 2819 2837 2820 /* kmem_cache debug support */ 2838 2821 s = slab_pre_alloc_hook(s, flags); 2839 - if (unlikely(!s)) { 2840 - __kmem_cache_free_bulk(s, i, p); 2841 - c->tid = next_tid(c->tid); 2842 - local_irq_enable(); 2843 - return false; 2844 - } 2822 + if (unlikely(!s)) 2823 + goto error; 2845 2824 2846 2825 c->freelist = get_freepointer(s, object); 2847 2826 p[i] = object; ··· 2854 2847 } 2855 2848 2856 2849 return true; 2850 + 2851 + error: 2852 + __kmem_cache_free_bulk(s, i, p); 2853 + local_irq_enable(); 2854 + return false; 2857 2855 } 2858 2856 EXPORT_SYMBOL(kmem_cache_alloc_bulk); 2859 2857
+2 -3
mm/vmalloc.c
··· 1443 1443 vmap_debug_free_range(va->va_start, va->va_end); 1444 1444 kasan_free_shadow(vm); 1445 1445 free_unmap_vmap_area(va); 1446 - vm->size -= PAGE_SIZE; 1447 1446 1448 1447 return vm; 1449 1448 } ··· 1467 1468 return; 1468 1469 } 1469 1470 1470 - debug_check_no_locks_freed(addr, area->size); 1471 - debug_check_no_obj_freed(addr, area->size); 1471 + debug_check_no_locks_freed(addr, get_vm_area_size(area)); 1472 + debug_check_no_obj_freed(addr, get_vm_area_size(area)); 1472 1473 1473 1474 if (deallocate_pages) { 1474 1475 int i;
+1
tools/vm/page-types.c
··· 128 128 [KPF_THP] = "t:thp", 129 129 [KPF_BALLOON] = "o:balloon", 130 130 [KPF_ZERO_PAGE] = "z:zero_page", 131 + [KPF_IDLE] = "i:idle_page", 131 132 132 133 [KPF_RESERVED] = "r:reserved", 133 134 [KPF_MLOCKED] = "m:mlocked",