Skip to content
  1. Dec 16, 2020
    • Bharata B Rao's avatar
      mm/slub: let number of online CPUs determine the slub page order · 045ab8c9
      Bharata B Rao authored
      The page order of the slab that gets chosen for a given slab cache depends
      on the number of objects that can be fit in the slab while meeting other
      requirements.  We start with a value of minimum objects based on
      nr_cpu_ids that is driven by possible number of CPUs and hence could be
      higher than the actual number of CPUs present in the system.  This leads
      to calculate_order() chosing a page order that is on the higher side
      leading to increased slab memory consumption on systems that have bigger
      page sizes.
      
      Hence rely on the number of online CPUs when determining the mininum
      objects, thereby increasing the chances of chosing a lower conservative
      page order for the slab.
      
      Vlastimil said:
        "Ideally, we would react to hotplug events and update existing caches
         accordingly. But for that, recalculation of order for existing caches
         would have to be made safe, while not affecting hot paths. We have
         removed the sysfs interface with 32a6f409
      
       ("mm, slub: remove
         runtime allocation order changes") as it didn't seem easy and worth
         the trouble.
      
         In case somebody wants to start with a large order right from the
         boot because they know they will hotplug lots of cpus later, they can
         use slub_min_objects= boot param to override this heuristic. So in
         case this change regresses somebody's performance, there's a way
         around it and thus the risk is low IMHO"
      
      Link: https://lkml.kernel.org/r/20201118082759.1413056-1-bharata@linux.ibm.com
      Signed-off-by: default avatarBharata B Rao <bharata@linux.ibm.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarRoman Gushchin <guro@fb.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Shakeel Butt <shakeelb@google.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      045ab8c9
    • Vlastimil Babka's avatar
      mm, slub: use kmem_cache_debug_flags() in deactivate_slab() · 965c4848
      Vlastimil Babka authored
      Commit 9cf7a111
      
       ("mm/slub: make add_full() condition more explicit")
      replaced an unnecessarily generic kmem_cache_debug(s) check with an
      explicit check of SLAB_STORE_USER and #ifdef CONFIG_SLUB_DEBUG.
      
      We can achieve the same specific check with the recently added
      kmem_cache_debug_flags() which removes the #ifdef and restores the
      no-branch-overhead benefit of static key check when slub debugging is not
      enabled.
      
      Link: https://lkml.kernel.org/r/3ef24214-38c7-1238-8296-88caf7f48ab6@suse.cz
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Abel Wu <wuyun.wu@huawei.com>
      Cc: Christopher Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Liu Xiang <liu.xiang6@zte.com.cn>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      965c4848
    • Alexander Popov's avatar
      mm/slab: rerform init_on_free earlier · a32d654d
      Alexander Popov authored
      
      
      Currently in CONFIG_SLAB init_on_free happens too late, and heap objects
      go to the heap quarantine not being erased.
      
      Lets move init_on_free clearing before calling kasan_slab_free().  In that
      case heap quarantine will store erased objects, similarly to CONFIG_SLUB=y
      behavior.
      
      Link: https://lkml.kernel.org/r/20201210183729.1261524-1-alex.popov@linux.com
      Signed-off-by: default avatarAlexander Popov <alex.popov@linux.com>
      Reviewed-by: default avatarAlexander Potapenko <glider@google.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Acked-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a32d654d
    • Vlastimil Babka's avatar
      mm, slab, slub: clear the slab_cache field when freeing page · 0c06dd75
      Vlastimil Babka authored
      
      
      The page allocator expects that page->mapping is NULL for a page being
      freed.  SLAB and SLUB use the slab_cache field which is in union with
      mapping, but before freeing the page, the field is referenced with the
      "mapping" name when set to NULL.
      
      It's IMHO more correct (albeit functionally the same) to use the
      slab_cache name as that's the field we use in SL*B, and document why we
      clear it in a comment (we don't clear fields such as s_mem or freelist, as
      page allocator doesn't care about those).  While using the 'mapping' name
      would automagically keep the code correct if the unions in struct page
      changed, such changes should be done consciously and needed changes
      evaluated - the comment should help with that.
      
      Link: https://lkml.kernel.org/r/20201210160020.21562-1-vbabka@suse.cz
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Acked-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Matthew Wilcox <willy@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0c06dd75
    • Bartosz Golaszewski's avatar
      dma-buf: use krealloc_array() · a47fc51d
      Bartosz Golaszewski authored
      
      
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-10-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a47fc51d
    • Bartosz Golaszewski's avatar
      hwtracing: intel: use krealloc_array() · f8f7e2bf
      Bartosz Golaszewski authored
      
      
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-9-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f8f7e2bf
    • Bartosz Golaszewski's avatar
      drm: atomic: use krealloc_array() · 32ce2553
      Bartosz Golaszewski authored
      
      
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-8-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      32ce2553
    • Bartosz Golaszewski's avatar
      edac: ghes: use krealloc_array() · af11be05
      Bartosz Golaszewski authored
      
      
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-7-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      af11be05
    • Bartosz Golaszewski's avatar
      pinctrl: use krealloc_array() · 2207994d
      Bartosz Golaszewski authored
      
      
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-6-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2207994d
    • Bartosz Golaszewski's avatar
      vhost: vringh: use krealloc_array() · 3a999748
      Bartosz Golaszewski authored
      
      
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-5-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3a999748
    • Bartosz Golaszewski's avatar
      ALSA: pcm: use krealloc_array() · 64f0bd11
      Bartosz Golaszewski authored
      
      
      Use the helper that checks for overflows internally instead of manually
      calculating the size of the new array.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-4-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      64f0bd11
    • Bartosz Golaszewski's avatar
      mm: slab: provide krealloc_array() · f0dbd2bd
      Bartosz Golaszewski authored
      
      
      When allocating an array of elements, users should check for
      multiplication overflow or preferably use one of the provided helpers
      like: kmalloc_array().
      
      There's no krealloc_array() counterpart but there are many users who use
      regular krealloc() to reallocate arrays.  Let's provide an actual
      krealloc_array() implementation.
      
      While at it: add some documentation regarding krealloc.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-3-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f0dbd2bd
    • Bartosz Golaszewski's avatar
      mm: slab: clarify krealloc()'s behavior with __GFP_ZERO · 15d5de49
      Bartosz Golaszewski authored
      
      
      Patch series "slab: provide and use krealloc_array()", v3.
      
      Andy brought to my attention the fact that users allocating an array of
      equally sized elements should check if the size multiplication doesn't
      overflow.  This is why we have helpers like kmalloc_array().
      
      However we don't have krealloc_array() equivalent and there are many users
      who do their own multiplication when calling krealloc() for arrays.
      
      This series provides krealloc_array() and uses it in a couple places.
      
      A separate series will follow adding devm_krealloc_array() which is needed
      in the xilinx adc driver.
      
      This patch (of 9):
      
      __GFP_ZERO is ignored by krealloc() (unless we fall-back to kmalloc()
      path, in which case it's honored).  Point that out in the kerneldoc.
      
      Link: https://lkml.kernel.org/r/20201109110654.12547-1-brgl@bgdev.pl
      Link: https://lkml.kernel.org/r/20201109110654.12547-2-brgl@bgdev.pl
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Christian Knig <christian.koenig@amd.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: James Morse <james.morse@arm.com>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: "Michael S . Tsirkin" <mst@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      15d5de49
    • Hui Su's avatar
      mm/slab_common.c: use list_for_each_entry in dump_unreclaimable_slab() · 7714304f
      Hui Su authored
      
      
      dump_unreclaimable_slab() acquires the slab_mutex first, and it won't
      remove any slab_caches list entry when itering the slab_caches lists.
      
      Thus we do not need list_for_each_entry_safe here, which is against
      removal of list entry.
      
      Link: https://lkml.kernel.org/r/20200926043440.GA180545@rlk
      Signed-off-by: default avatarHui Su <sh_def@163.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7714304f
    • Colin Ian King's avatar
      arch/Kconfig: fix spelling mistakes · a86ecfa6
      Colin Ian King authored
      
      
      There are a few spelling mistakes in the Kconfig comments and help text.
      Fix these.
      
      Link: https://lkml.kernel.org/r/20201207155004.171962-1-colin.king@canonical.com
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a86ecfa6
    • Mauricio Faria de Oliveira's avatar
      ocfs2: ratelimit the 'max lookup times reached' notice · 45680967
      Mauricio Faria de Oliveira authored
      
      
      Running stress-ng on ocfs2 completely fills the kernel log with 'max
      lookup times reached, filesystem may have nested directories.'
      
      Let's ratelimit this message as done with others in the code.
      
      Test-case:
      
        # mkfs.ocfs2 --mount local $DEV
        # mount $DEV $MNT
        # cd $MNT
      
        # dmesg -C
        # stress-ng --dirdeep 1 --dirdeep-ops 1000
        # dmesg | grep -c 'max lookup times reached'
      
      Before:
      
        # dmesg -C
        # stress-ng --dirdeep 1 --dirdeep-ops 1000
        ...
        stress-ng: info:  [11116] successful run completed in 3.03s
      
        # dmesg | grep -c 'max lookup times reached'
        967
      
      After:
      
        # dmesg -C
        # stress-ng --dirdeep 1 --dirdeep-ops 1000
        ...
        stress-ng: info:  [739] successful run completed in 0.96s
      
        # dmesg | grep -c 'max lookup times reached'
        10
      
        # dmesg
        [  259.086086] ocfs2_check_if_ancestor: 1990 callbacks suppressed
        [  259.086092] (stress-ng-dirde,740,1):ocfs2_check_if_ancestor:1091 max lookup times reached, filesystem may have nested directories, src inode: 18007, dest inode: 17940.
        ...
      
      Link: https://lkml.kernel.org/r/20201001224417.478263-1-mfo@canonical.com
      Signed-off-by: default avatarMauricio Faria de Oliveira <mfo@canonical.com>
      Reviewed-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Changwei Ge <gechangwei@live.cn>
      Cc: Gang He <ghe@suse.com>
      Cc: Jun Piao <piaojun@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      45680967
    • Tom Rix's avatar
      fs/ocfs2/cluster/tcp.c: remove unneeded break · a0823b5e
      Tom Rix authored
      
      
      A break is not needed if it is preceded by a goto
      
      Link: https://lkml.kernel.org/r/20201019175216.2329-1-trix@redhat.com
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Acked-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Changwei Ge <gechangwei@live.cn>
      Cc: Gang He <ghe@suse.com>
      Cc: Jun Piao <piaojun@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a0823b5e
    • Alex Shi's avatar
      fs/ntfs: remove unused variable attr_len · 4dad18f4
      Alex Shi authored
      
      
      This variable isn't used anymore, remove it to skip W=1 warning:
      
        fs/ntfs/inode.c:2350:6: warning: variable `attr_len' set but not used [-Wunused-but-set-variable]
      
      Link: https://lkml.kernel.org/r/4194376f-898b-b602-81c3-210567712092@linux.alibaba.com
      Signed-off-by: default avatarAlex Shi <alex.shi@linux.alibaba.com>
      Acked-by: default avatarAnton Altaparmakov <anton@tuxera.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4dad18f4
    • Alex Shi's avatar
      fs/ntfs: remove unused varibles · 3f10c2fa
      Alex Shi authored
      
      
      We actually don't use these varibles, so remove them to avoid gcc warning:
      
        fs/ntfs/file.c:326:14: warning: variable `base_ni' set but not used [-Wunused-but-set-variable]
        fs/ntfs/logfile.c:481:21: warning: variable `log_page_mask' set but not used [-Wunused-but-set-variable]
      
      Link: https://lkml.kernel.org/r/1604821092-54631-1-git-send-email-alex.shi@linux.alibaba.com
      Signed-off-by: default avatarAlex Shi <alex.shi@linux.alibaba.com>
      Acked-by: default avatarAnton Altaparmakov <anton@tuxera.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3f10c2fa
    • Sebastian Andrzej Siewior's avatar
      ide: remove BUG_ON(in_interrupt() || irqs_disabled()) from ide_unregister() · ec680c19
      Sebastian Andrzej Siewior authored
      
      
      In the discussion about preempt count consistency across kernel
      configurations:
      
       https://lore.kernel.org/r/20200914204209.256266093@linutronix.de/
      
      it was concluded that the usage of in_interrupt() and related context
      checks should be removed from non-core code.
      
      Both BUG_ON()s in ide-probe.c were introduced in commit
         4015c949fb465 ("[PATCH] update ide core")
      
      when ide_unregister() was extended with semaphore based locking.  Both
      checks won't complain about disabled preemption which is also wrong.
      
      The might_sleep() in today's mutex_lock() will complain about the
      missuses.
      
      Remove the BUG_ON() statements.
      
      Link: https://lkml.kernel.org/r/20201120092421.1023428-3-bigeasy@linutronix.de
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: default avatarJens Axboe <axboe@kernel.dk>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ec680c19
    • Sebastian Andrzej Siewior's avatar
      ide/falcon: remove in_interrupt() usage · 483e6417
      Sebastian Andrzej Siewior authored
      
      
      falconide_get_lock() is called by ide_lock_host() and its caller
      (ide_issue_rq()) has already a might_sleep() check.
      
      stdma_lock() has wait_event() which also has a might_sleep() check.
      
      Remove the in_interrupt() check.
      
      Link: https://lkml.kernel.org/r/20201113161021.2217361-2-bigeasy@linutronix.de
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      483e6417
    • Petr Vorel's avatar
      uapi: move constants from <linux/kernel.h> to <linux/const.h> · a85cbe61
      Petr Vorel authored
      
      
      and include <linux/const.h> in UAPI headers instead of <linux/kernel.h>.
      
      The reason is to avoid indirect <linux/sysinfo.h> include when using
      some network headers: <linux/netlink.h> or others -> <linux/kernel.h>
      -> <linux/sysinfo.h>.
      
      This indirect include causes on MUSL redefinition of struct sysinfo when
      included both <sys/sysinfo.h> and some of UAPI headers:
      
          In file included from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5,
                           from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5,
                           from ../include/tst_netlink.h:14,
                           from tst_crypto.c:13:
          x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: error: redefinition of `struct sysinfo'
           struct sysinfo {
                  ^~~~~~~
          In file included from ../include/tst_safe_macros.h:15,
                           from ../include/tst_test.h:93,
                           from tst_crypto.c:11:
          x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: originally defined here
      
      Link: https://lkml.kernel.org/r/20201015190013.8901-1-petr.vorel@gmail.com
      Signed-off-by: default avatarPetr Vorel <petr.vorel@gmail.com>
      Suggested-by: default avatarRich Felker <dalias@aerifal.cx>
      Acked-by: default avatarRich Felker <dalias@libc.org>
      Cc: Peter Korsgaard <peter@korsgaard.com>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Florian Weimer <fweimer@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a85cbe61
    • Petr Mladek's avatar
      kthread_worker: document CPU hotplug handling · ebb2bdce
      Petr Mladek authored
      
      
      The kthread worker API is simple.  In short, it allows to create, use, and
      destroy workers.  kthread_create_worker_on_cpu() just allows to bind a
      newly created worker to a given CPU.
      
      It is up to the API user how to handle CPU hotplug.  They have to decide
      how to handle pending work items, prevent queuing new ones, and restore
      the functionality when the CPU goes off and on.  There are few catches:
      
         + The CPU affinity gets lost when it is scheduled on an offline CPU.
      
         + The worker might not exist when the CPU was off when the user
           created the workers.
      
      A good practice is to implement two CPU hotplug callbacks and
      destroy/create the worker when CPU goes down/up.
      
      Mention this in the function description.
      
      [akpm@linux-foundation.org: grammar tweaks]
      
      Link: https://lore.kernel.org/r/20201028073031.4536-1-qiang.zhang@windriver.com
      Link: https://lkml.kernel.org/r/20201102101039.19227-1-pmladek@suse.com
      Reported-by: default avatarZhang Qiang <Qiang.Zhang@windriver.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ebb2bdce
    • Rob Clark's avatar
      kthread: add kthread_work tracepoints · f630c7c6
      Rob Clark authored
      
      
      While migrating some code from wq to kthread_worker, I found that I missed
      the execute_start/end tracepoints.  So add similar tracepoints for
      kthread_work.  And for completeness, queue_work tracepoint (although this
      one differs slightly from the matching workqueue tracepoint).
      
      Link: https://lkml.kernel.org/r/20201010180323.126634-1-robdclark@gmail.com
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Cc: Rob Clark <robdclark@chromium.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
      Cc: Phil Auld <pauld@redhat.com>
      Cc: Valentin Schneider <valentin.schneider@arm.com>
      Cc: Thara Gopinath <thara.gopinath@linaro.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Vincent Donnefort <vincent.donnefort@arm.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Frederic Weisbecker <frederic@kernel.org>
      Cc: Ilias Stamatis <stamatis.iliass@gmail.com>
      Cc: Liang Chen <cl@rock-chips.com>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: "J. Bruce Fields" <bfields@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f630c7c6
  2. Dec 14, 2020
    • Linus Torvalds's avatar
      Linux 5.10 · 2c85ebc5
      Linus Torvalds authored
      2c85ebc5
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-12-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ec6f5e0e
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of x86 and membarrier fixes:
      
         - Correct a few problems in the x86 and the generic membarrier
           implementation. Small corrections for assumptions about visibility
           which have turned out not to be true.
      
         - Make the PAT bits for memory encryption correct vs 4K and 2M/1G
           page table entries as they are at a different location.
      
         - Fix a concurrency issue in the the local bandwidth readout of
           resource control leading to incorrect values
      
         - Fix the ordering of allocating a vector for an interrupt. The order
           missed to respect the provided cpumask when the first attempt of
           allocating node local in the mask fails. It then tries the node
           instead of trying the full provided mask first. This leads to
           erroneous error messages and breaking the (user) supplied affinity
           request. Reorder it.
      
         - Make the INT3 padding detection in optprobe work correctly"
      
      * tag 'x86-urgent-2020-12-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/kprobes: Fix optprobe to detect INT3 padding correctly
        x86/apic/vector: Fix ordering in vector assignment
        x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled
        x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
        membarrier: Execute SYNC_CORE on the calling thread
        membarrier: Explicitly sync remote cores when SYNC_CORE is requested
        membarrier: Add an actual barrier before rseq_preempt()
        x86/membarrier: Get rid of a dubious optimization
      ec6f5e0e
    • Linus Torvalds's avatar
      Merge tag 'block-5.10-2020-12-12' of git://git.kernel.dk/linux-block · d2360a39
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "This should be it for 5.10.
      
        Mike and Song looked into the warning case, and thankfully it appears
        the fix was pretty trivial - we can just change the md device chunk
        type to unsigned int to get rid of it. They cannot currently be < 0,
        and nobody is checking for that either.
      
        We're reverting the discard changes as the corruption reports came in
        very late, and there's just no time to attempt to deal with it at this
        point. Reverting the changes in question is the right call for 5.10"
      
      * tag 'block-5.10-2020-12-12' of git://git.kernel.dk/linux-block:
        md: change mddev 'chunk_sectors' from int to unsigned
        Revert "md: add md_submit_discard_bio() for submitting discard bio"
        Revert "md/raid10: extend r10bio devs to raid disks"
        Revert "md/raid10: pull codes that wait for blocked dev into one function"
        Revert "md/raid10: improve raid10 discard request"
        Revert "md/raid10: improve discard request for far layout"
        Revert "dm raid: remove unnecessary discard limits for raid10"
      d2360a39
  3. Dec 13, 2020
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 6bff9bb8
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Five small fixes.  Four in drivers:
      
         - hisi_sas: fix internal queue timeout
      
         - be2iscsi: revert a prior fix causing problems
      
         - bnx2i: add missing dependency
      
         - storvsc: late arriving revert of a problem fix
      
        and one in the core.
      
        The core one is a minor change to stop paying attention to the busy
        count when returning out of resources because there's a race window
        where the queue might not restart due to missing returning I/O"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        Revert "scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()"
        scsi: hisi_sas: Select a suitable queue for internal I/Os
        scsi: core: Fix race between handling STS_RESOURCE and completion
        scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
        scsi: bnx2i: Requires MMU
      6bff9bb8
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 5ee595d9
      Linus Torvalds authored
      Pull i2c fix from Wolfram Sang:
       "Bugfix for the AT24 EEPROM driver"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        misc: eeprom: at24: fix NVMEM name with custom AT24 device name
      5ee595d9
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 7b1b868e
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "Bugfixes for ARM, x86 and tools"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        tools/kvm_stat: Exempt time-based counters
        KVM: mmu: Fix SPTE encoding of MMIO generation upper half
        kvm: x86/mmu: Use cpuid to determine max gfn
        kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit()
        selftests: kvm/set_memory_region_test: Fix race in move region test
        KVM: arm64: Add usage of stage 2 fault lookup level in user_mem_abort()
        KVM: arm64: Fix handling of merging tables into a block entry
        KVM: arm64: Fix memory leak on stage2 update of a valid PTE
      7b1b868e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.10c-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · b53966ff
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "A short series fixing a regression introduced in 5.9 for running as
        Xen dom0 on a system with NVMe backed storage"
      
      * tag 'for-linus-5.10c-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen: don't use page->lru for ZONE_DEVICE memory
        xen: add helpers for caching grant mapping pages
      b53966ff
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · b01deddb
      Linus Torvalds authored
      Pull RISC-V fix from Palmer Dabbelt:
       "Just one fix. It's nothing critical, just a randconfig that wasn't
        building. That said, it does seem pretty safe and is technically a
        regression so I'm sending it along for 5.10:
      
         - define get_cycles64() all the time, as it's used by most
           configurations"
      
      * tag 'riscv-for-linus-5.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: Define get_cycles64() regardless of M-mode
      b01deddb
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.10-2020-12-11' of git://git.kernel.dk/linux-block · 31d00f6e
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Two fixes in here, fixing issues introduced in this merge window"
      
      * tag 'io_uring-5.10-2020-12-11' of git://git.kernel.dk/linux-block:
        io_uring: fix file leak on error path of io ctx creation
        io_uring: fix mis-seting personality's creds
      31d00f6e
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 643e69af
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
      
       - a fix for cm109 stomping on its own control URB if it tries to toggle
         buzzer immediately after userspace opens input device (found by
         syzcaller)
      
       - another fix for Raydium touchscreens that do not like splitting
         command transfers
      
       - quirks for i8042, soc_button_array, and goodix drivers to make them
         work better with certain hardware.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
        Input: cm109 - do not stomp on control URB
        Input: i8042 - add Acer laptops to the i8042 reset list
        Input: cros_ec_keyb - send 'scancodes' in addition to key events
        Input: soc_button_array - add Lenovo Yoga Tablet2 1051L to the dmi_use_low_level_irq list
        Input: raydium_ts_i2c - do not split tx transactions
      643e69af
    • Mike Snitzer's avatar
      md: change mddev 'chunk_sectors' from int to unsigned · 6ffeb1c3
      Mike Snitzer authored
      Commit e2782f56 ("Revert "dm raid: remove unnecessary discard
      limits for raid10"") exposed compiler warnings introduced by commit
      e0910c8e
      
       ("dm raid: fix discard limits for raid1 and raid10"):
      
      In file included from ./include/linux/kernel.h:14,
                       from ./include/asm-generic/bug.h:20,
                       from ./arch/x86/include/asm/bug.h:93,
                       from ./include/linux/bug.h:5,
                       from ./include/linux/mmdebug.h:5,
                       from ./include/linux/gfp.h:5,
                       from ./include/linux/slab.h:15,
                       from drivers/md/dm-raid.c:8:
      drivers/md/dm-raid.c: In function ‘raid_io_hints’:
      ./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
        (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                  ^~
      ./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’
         (__typecheck(x, y) && __no_side_effects(x, y))
          ^~~~~~~~~~~
      ./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’
        __builtin_choose_expr(__safe_cmp(x, y), \
                              ^~~~~~~~~~
      ./include/linux/minmax.h:51:19: note: in expansion of macro ‘__careful_cmp’
       #define min(x, y) __careful_cmp(x, y, <)
                         ^~~~~~~~~~~~~
      ./include/linux/minmax.h:84:39: note: in expansion of macro ‘min’
        __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
                                             ^~~
      drivers/md/dm-raid.c:3739:33: note: in expansion of macro ‘min_not_zero’
         limits->max_discard_sectors = min_not_zero(rs->md.chunk_sectors,
                                       ^~~~~~~~~~~~
      
      Fix this by changing the chunk_sectors member of 'struct mddev' from
      int to 'unsigned int' to match the type used for the 'chunk_sectors'
      member of 'struct queue_limits'.  Various MD code still uses 'int' but
      none of it appears to ever make use of signed int; and storing
      positive signed int in unsigned is perfectly safe.
      
      Reported-by: default avatarSong Liu <songliubraving@fb.com>
      Fixes: e2782f56 ("Revert "dm raid: remove unnecessary discard limits for raid10"")
      Fixes: e0910c8e ("dm raid: fix discard limits for raid1 and raid10")
      Cc: stable@vger,kernel.org # e0910c8e
      
       was marked for stable@
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Reviewed-by: default avatarSong Liu <song@kernel.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6ffeb1c3
  4. Dec 12, 2020
    • Masami Hiramatsu's avatar
      x86/kprobes: Fix optprobe to detect INT3 padding correctly · 0d07c0ec
      Masami Hiramatsu authored
      Commit
      
        7705dc85 ("x86/vmlinux: Use INT3 instead of NOP for linker fill bytes")
      
      changed the padding bytes between functions from NOP to INT3. However,
      when optprobe decodes a target function it finds INT3 and gives up the
      jump optimization.
      
      Instead of giving up any INT3 detection, check whether the rest of the
      bytes to the end of the function are INT3. If all of them are INT3,
      those come from the linker. In that case, continue the optprobe jump
      optimization.
      
       [ bp: Massage commit message. ]
      
      Fixes: 7705dc85
      
       ("x86/vmlinux: Use INT3 instead of NOP for linker fill bytes")
      Reported-by: default avatarAdam Zabrocki <pi3@pi3.com.pl>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/160767025681.3880685.16021570341428835411.stgit@devnote2
      0d07c0ec
    • Simon Beginn's avatar
      Input: goodix - add upside-down quirk for Teclast X98 Pro tablet · cffdd6d9
      Simon Beginn authored
      
      
      The touchscreen on the Teclast x98 Pro is also mounted upside-down in
      relation to the display orientation.
      
      Signed-off-by: default avatarSimon Beginn <linux@simonmicro.de>
      Signed-off-by: default avatarBastien Nocera <hadess@hadess.net>
      Link: https://lore.kernel.org/r/20201117004253.27A5A27EFD@localhost
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      cffdd6d9
    • Stefan Raspl's avatar
      tools/kvm_stat: Exempt time-based counters · 111d0bda
      Stefan Raspl authored
      
      
      The new counters halt_poll_success_ns and halt_poll_fail_ns do not count
      events. Instead they provide a time, and mess up our statistics. Therefore,
      we should exclude them.
      Removal is currently implemented with an exempt list. If more counters like
      these appear, we can think about a more general rule like excluding all
      fields name "*_ns", in case that's a standing convention.
      
      Signed-off-by: default avatarStefan Raspl <raspl@linux.ibm.com>
      Tested-and-reported-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Message-Id: <20201208210829.101324-1-raspl@linux.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      111d0bda
    • Maciej S. Szmigiero's avatar
      KVM: mmu: Fix SPTE encoding of MMIO generation upper half · 34c0f6f2
      Maciej S. Szmigiero authored
      Commit cae7ed3c ("KVM: x86: Refactor the MMIO SPTE generation handling")
      cleaned up the computation of MMIO generation SPTE masks, however it
      introduced a bug how the upper part was encoded:
      SPTE bits 52-61 were supposed to contain bits 10-19 of the current
      generation number, however a missing shift encoded bits 1-10 there instead
      (mostly duplicating the lower part of the encoded generation number that
      then consisted of bits 1-9).
      
      In the meantime, the upper part was shrunk by one bit and moved by
      subsequent commits to become an upper half of the encoded generation number
      (bits 9-17 of bits 0-17 encoded in a SPTE).
      
      In addition to the above, commit 56871d44 ("KVM: x86: fix overlap between SPTE_MMIO_MASK and generation")
      has changed the SPTE bit range assigned to encode the generation number and
      the total number of bits encoded but did not update them in the comment
      attached to their defines, nor in the KVM MMU doc.
      Let's do it here, too, since it is too trivial thing to warrant a separate
      commit.
      
      Fixes: cae7ed3c
      
       ("KVM: x86: Refactor the MMIO SPTE generation handling")
      Signed-off-by: default avatarMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
      Message-Id: <156700708db2a5296c5ed7a8b9ac71f1e9765c85.1607129096.git.maciej.szmigiero@oracle.com>
      Cc: stable@vger.kernel.org
      [Reorganize macros so that everything is computed from the bit ranges. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      34c0f6f2
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-5.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · 7f376f19
      Linus Torvalds authored
      Pull mtd fixes from Miquel Raynal:
       "Second series of fixes for raw NAND drivers initiated because of a
        rework of the ECC engine subsystem.
      
        The location of the DT parsing logic got moved, breaking several
        drivers which in fact were not doing the ECC engine initialization at
        the right place.
      
        These drivers have been fixed by enforcing a particular ECC engine
        type and algorithm, software Hamming, while the algorithm may be
        overwritten by a DT property. This merge request fixes this in the
        xway, socrates, plat_nand, pasemi, orion, mpc5121, gpio, au1550 and
        ams-delta controller drivers"
      
      * tag 'mtd/fixes-for-5.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: xway: Do not force a particular software ECC engine
        mtd: rawnand: socrates: Do not force a particular software ECC engine
        mtd: rawnand: plat_nand: Do not force a particular software ECC engine
        mtd: rawnand: pasemi: Do not force a particular software ECC engine
        mtd: rawnand: orion: Do not force a particular software ECC engine
        mtd: rawnand: mpc5121: Do not force a particular software ECC engine
        mtd: rawnand: gpio: Do not force a particular software ECC engine
        mtd: rawnand: au1550: Do not force a particular software ECC engine
        mtd: rawnand: ams-delta: Do not force a particular software ECC engine
      7f376f19