From: Kent Overstreet
This patch adds lib/lazy-percpu-counter.c, which implements counters
that start out as atomics, but lazily switch to percpu mode if the
update rate crosses some threshold (arbitrarily set at 256 per second).
Signed-off-by: Kent Overstreet
---
include/linux/lazy-percpu-cou
Introduce CONFIG_ALLOC_TAGGING which provides definitions to easily
instrument allocators. It also registers an "alloc_tags" codetag type
with defbugfs interface to output allocation tags information.
Signed-off-by: Suren Baghdasaryan
Co-developed-by: Kent Overstreet
Signed-of
mark these
caches and avoid creating extensions for objects allocated from these
slabs.
Signed-off-by: Suren Baghdasaryan
---
include/linux/slab.h | 7 +++
mm/slab.c| 2 +-
mm/slub.c| 5 +++--
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/linu
Allow find_kallsyms_symbol_value to be called by code outside of
kernel/module. It will be used for code tagging module support.
Signed-off-by: Suren Baghdasaryan
---
include/linux/module.h | 1 +
kernel/module/internal.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a
From: Kent Overstreet
Previously, string_get_size() outputted a space between the number and
the units, i.e.
9.88 MiB
This changes it to
9.88MiB
which allows it to be parsed correctly by the 'sort -h' command.
Signed-off-by: Kent Overstreet
Cc: Andy Shevchenko
Cc: Michael Ellerman
Cc: B
Code tagging based latency tracking
Improved symbolic error names
dyndbg: Convert to code tagging
MAINTAINERS: Add entries for code tagging & related
Suren Baghdasaryan (16):
kernel/module: move find_kallsyms_symbol_value declaration
lib: code tagging framework
lib: code tagg
Overstreet
Signed-off-by: Suren Baghdasaryan
---
include/linux/codetag.h | 71 ++
lib/Kconfig.debug | 4 +
lib/Makefile| 1 +
lib/codetag.c | 199
4 files changed, 275 insertions(+)
create mode 100644 include/linux
Add support for code tagging from dynamically loaded modules.
Signed-off-by: Suren Baghdasaryan
Co-developed-by: Kent Overstreet
Signed-off-by: Kent Overstreet
---
include/linux/codetag.h | 12 ++
kernel/module/main.c| 4
lib/codetag.c | 51
From: Kent Overstreet
These symbols are used to denote section boundaries: by always including
them we can unify loading sections from modules with loading built-in
sections, which leads to some significant cleanup.
Signed-off-by: Kent Overstreet
---
scripts/kallsyms.c | 13 +
1 fi
Introduce CONFIG_PAGE_ALLOC_TAGGING which provides helper functions to
easily instrument page allocators and adds a page_ext field to store a
pointer to the allocation tag associated with the code that allocated
the page.
Signed-off-by: Suren Baghdasaryan
Co-developed-by: Kent Overstreet
Signed
Introduce __GFP_NO_OBJ_EXT flag in order to prevent recursive allocations
when allocating slabobj_ext on a slab.
Signed-off-by: Suren Baghdasaryan
---
include/linux/gfp_types.h | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/linux/gfp_types.h b/include
to its codetag_with_ctx object with embedded
codetag object in it. All context objects of the same code tag are placed
into codetag_with_ctx.ctx_head linked list. codetag.flag is used to
indicate when a context capture for the associated code tag is
initialized and enabled.
Signed-off-by: Suren
After redefining alloc_pages, all uses of that name are being replaced.
Change the conflicting names to prevent preprocessor from replacing them
when it's not intended.
Signed-off-by: Suren Baghdasaryan
---
arch/x86/kernel/amd_gart_64.c | 2 +-
drivers/iommu/dma-iommu.c | 2 +-
driver
Redefine alloc_pages, __get_free_pages to record allocations done by
these functions. Instrument deallocation hooks to record object freeing.
Signed-off-by: Suren Baghdasaryan
---
include/linux/gfp.h | 10 +++---
include/linux/page_ext.h| 3 ++-
include/linux/pgalloc_tag.h | 35
Use __GFP_NO_OBJ_EXT to prevent recursions when allocating slabobj_ext
objects. Also prevent slabobj_ext allocations for kmem_cache objects.
Signed-off-by: Suren Baghdasaryan
---
mm/memcontrol.c | 2 ++
mm/slab.h | 6 ++
2 files changed, 8 insertions(+)
diff --git a/mm/memcontrol.c b
so avoiding this until v1.
Signed-off-by: Suren Baghdasaryan
---
include/linux/memcontrol.h | 18 --
init/Kconfig | 5 ++
mm/kfence/core.c | 2 +-
mm/memcontrol.c| 60 ++-
mm/page_owner.c| 2 +-
mm/sla
Introduce CONFIG_SLAB_ALLOC_TAGGING which provides helper functions
to easily instrument slab allocators and adds a codetag_ref field into
slabobj_ext to store a pointer to the allocation tag associated with
the code that allocated the slab object.
Signed-off-by: Suren Baghdasaryan
Co-developed
From: Kent Overstreet
This adds a new helper which is like strsep, except that it skips empty
tokens.
Signed-off-by: Kent Overstreet
---
include/linux/string.h | 1 +
lib/string.c | 19 +++
2 files changed, 20 insertions(+)
diff --git a/include/linux/string.h b/incl
Redefine kmalloc, krealloc, kzalloc, kcalloc, etc. to record allocations
and deallocations done by these functions.
Signed-off-by: Suren Baghdasaryan
Co-developed-by: Kent Overstreet
Signed-off-by: Kent Overstreet
---
include/linux/slab.h | 103 +--
mm
nclude/asm-generic/pgalloc.h line 63 disable" > \
/sys/kernel/debug/alloc_tags.ctx
Note that disabling context capture will not clear already captured
context but no new context will be captured.
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 28 -
include/linux
From: Kent Overstreet
Provide codetag_query_parse() to parse codetag queries and
codetag_matches_query() to check if the query affects a given codetag.
Signed-off-by: Kent Overstreet
---
include/linux/codetag.h | 27
lib/codetag.c | 135 +
From: Kent Overstreet
This adds a new fault injection capability, based on code tagging.
To use, simply insert somewhere in your code
dynamic_fault("fault_class_name")
and check whether it returns true - if so, inject the error.
For example
if (dynamic_fault("init"))
return -EINVAL;
Make save_stack() function part of stackdepot API to be used outside of
page_owner. Also rename task_struct's in_page_owner to in_capture_stack
flag to better convey the wider use of this flag.
Signed-off-by: Suren Baghdasaryan
---
include/linux/sched.h | 6 ++--
include/
From: Kent Overstreet
This patch converts bcache to the new generic time_stats code
lib/time_stats.c. The new code is from bcachefs, and has some changes
from the version in bcache:
- we now use ktime_get_ns(), not local_clock(). When the code was
originally written multi processor systems t
From: Kent Overstreet
This adds a small new library for tracking statistics on events that
have a duration, i.e. a start and end time.
- number of events
- rate/frequency
- average duration
- max duration
- duration quantiles
This code comes from bcachefs, and originally bcache: the next p
From: Kent Overstreet
Cleanup for code tagging latency tracking:
Add an initializer, WAIT_FUNC_INITIALIZER(), to be used by initializers
for structs that include wait_queue_entries.
Also, change init_wait(), init_wait_entry etc. to be a wrapper around
the new __init_waitqueue_entry(); more de-
4bcb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5111,6 +5111,19 @@ S: Supported
F: Documentation/process/code-of-conduct-interpretation.rst
F: Documentation/process/code-of-conduct.rst
+CODE TAGGING
+M: Suren Baghdasaryan
+M: Kent Overstreet
+S: Maintained
+F:
From: Kent Overstreet
This converts dynamic debug to the new code tagging framework, which
provides an interface for iterating over objects in a particular elf
section.
It also converts the debugfs interface from seq_file to the style used
by other code tagging users, which also makes the code a
From: Kent Overstreet
This patch adds per-error-site error codes, with error strings that
include their file and line number.
To use, change code that returns an error, e.g.
return -ENOMEM;
to
return -ERR(ENOMEM);
Then, errname() will return a string that includes the file and line
numb
From: Kent Overstreet
We need ktime.h for ktime_t.
Signed-off-by: Kent Overstreet
---
include/linux/timekeeping.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index fe1e467ba046..7c43e98cf211 100644
--- a/include/linux/timekeepin
From: Kent Overstreet
This adds the ability to easily instrument code for measuring latency.
To use, add the following to calls to your code, at the start and end of
the event you wish to measure:
code_tag_time_stats_start(start_time);
code_tag_time_stats_finish(start_time);
Stastistics wil
On Wed, Aug 31, 2022 at 3:47 AM Michal Hocko wrote:
>
> On Wed 31-08-22 11:19:48, Mel Gorman wrote:
> > On Wed, Aug 31, 2022 at 04:42:30AM -0400, Kent Overstreet wrote:
> > > On Wed, Aug 31, 2022 at 09:38:27AM +0200, Peter Zijlstra wrote:
> > > > On Tue, Aug 30
On Wed, Aug 31, 2022 at 3:02 AM Mel Gorman wrote:
>
> On Tue, Aug 30, 2022 at 02:48:52PM -0700, Suren Baghdasaryan wrote:
> > From: Kent Overstreet
> >
> > This patch adds lib/lazy-percpu-counter.c, which implements counters
> > that start out as atomics, but lazil
On Wed, Aug 31, 2022 at 3:11 AM Mel Gorman wrote:
>
> On Tue, Aug 30, 2022 at 02:48:59PM -0700, Suren Baghdasaryan wrote:
> > Redefine alloc_pages, __get_free_pages to record allocations done by
> > these functions. Instrument deallocation hooks to record object freeing.
>
On Wed, Aug 31, 2022 at 3:37 AM Dmitry Vyukov wrote:
>
> On Tue, 30 Aug 2022 at 23:50, Suren Baghdasaryan wrote:
> >
> > From: Kent Overstreet
> >
> > This adds a new fault injection capability, based on code tagging.
> >
> > To use, simply insert some
On Wed, Aug 31, 2022 at 8:45 AM Suren Baghdasaryan wrote:
>
> On Wed, Aug 31, 2022 at 3:11 AM Mel Gorman wrote:
> >
> > On Tue, Aug 30, 2022 at 02:48:59PM -0700, Suren Baghdasaryan wrote:
> > > Redefine alloc_pages, __get_free_pages to record allocations done by
> &
On Tue, Aug 30, 2022 at 6:53 PM Randy Dunlap wrote:
>
>
>
> On 8/30/22 14:49, Suren Baghdasaryan wrote:
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index b7d03afbc808..b0f86643b8f0 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.deb
On Tue, Aug 30, 2022 at 6:52 PM Randy Dunlap wrote:
>
>
>
> On 8/30/22 14:49, Suren Baghdasaryan wrote:
> > From: Kent Overstreet
> >
> > This adds a new fault injection capability, based on code tagging.
> >
> > To use, simply insert some
On Wed, Aug 31, 2022 at 8:28 AM Suren Baghdasaryan wrote:
>
> On Wed, Aug 31, 2022 at 3:47 AM Michal Hocko wrote:
> >
> > On Wed 31-08-22 11:19:48, Mel Gorman wrote:
> > > On Wed, Aug 31, 2022 at 04:42:30AM -0400, Kent Overstreet wrote:
> > > > On Wed,
On Wed, Aug 31, 2022 at 1:56 PM Yosry Ahmed wrote:
>
> On Wed, Aug 31, 2022 at 12:02 PM Kent Overstreet
> wrote:
> >
> > On Wed, Aug 31, 2022 at 12:47:32PM +0200, Michal Hocko wrote:
> > > On Wed 31-08-22 11:19:48, Mel Gorman wrote:
> > > > Whatever asking for an explanation as to why equivalent
On Wed, Aug 31, 2022 at 10:46 AM Kent Overstreet
wrote:
>
> On Wed, Aug 31, 2022 at 11:11:03AM +0100, Mel Gorman wrote:
> > On Tue, Aug 30, 2022 at 02:48:59PM -0700, Suren Baghdasaryan wrote:
> > > Redefine alloc_pages, __get_free_pages to record allocations done by
On Wed, Aug 31, 2022 at 9:52 PM Oscar Salvador wrote:
>
> On Tue, Aug 30, 2022 at 02:48:49PM -0700, Suren Baghdasaryan wrote:
> > ===
> > Code tagging framework
> > ===
> > Code tag is a structure identifying a specif
On Thu, Sep 1, 2022 at 12:18 AM Michal Hocko wrote:
>
> On Wed 31-08-22 15:01:54, Kent Overstreet wrote:
> > On Wed, Aug 31, 2022 at 12:47:32PM +0200, Michal Hocko wrote:
> > > On Wed 31-08-22 11:19:48, Mel Gorman wrote:
> > > > Whatever asking for an explanation as to why equivalent functionality
On Thu, Sep 1, 2022 at 8:07 AM David Hildenbrand wrote:
>
> On 01.09.22 16:23, Kent Overstreet wrote:
> > On Thu, Sep 01, 2022 at 10:05:03AM +0200, David Hildenbrand wrote:
> >> On 31.08.22 21:01, Kent Overstreet wrote:
> >>> On Wed, Aug 31, 2022 at 12:47:32PM +0200, Michal Hocko wrote:
> On
On Thu, Sep 1, 2022 at 12:15 PM Michal Hocko wrote:
>
> On Thu 01-09-22 08:33:19, Suren Baghdasaryan wrote:
> > On Thu, Sep 1, 2022 at 12:18 AM Michal Hocko wrote:
> [...]
> > > So I find Peter's question completely appropriate while your response to
> > >
On Thu, Sep 1, 2022 at 3:54 PM Roman Gushchin wrote:
>
> On Thu, Sep 01, 2022 at 06:37:20PM -0400, Kent Overstreet wrote:
> > On Thu, Sep 01, 2022 at 03:27:27PM -0700, Roman Gushchin wrote:
> > > On Wed, Aug 31, 2022 at 01:56:08PM -0700, Yosry Ahmed wrote:
> > > > This is very interesting work! Do
On Thu, Sep 1, 2022 at 4:36 PM Roman Gushchin wrote:
>
> On Tue, Aug 30, 2022 at 02:49:00PM -0700, Suren Baghdasaryan wrote:
> > Currently slab pages can store only vectors of obj_cgroup pointers in
> > page->memcg_data. Introduce slabobj_ext structure to allow more data
>
On Thu, Sep 1, 2022 at 4:41 PM Roman Gushchin wrote:
>
> On Tue, Aug 30, 2022 at 02:49:03PM -0700, Suren Baghdasaryan wrote:
> > Use __GFP_NO_OBJ_EXT to prevent recursions when allocating slabobj_ext
> > objects. Also prevent slabobj_ext allocations for kmem_cache objects.
>
On Thu, Sep 1, 2022 at 12:15 PM Michal Hocko wrote:
>
> On Thu 01-09-22 08:33:19, Suren Baghdasaryan wrote:
> > On Thu, Sep 1, 2022 at 12:18 AM Michal Hocko wrote:
> [...]
> > > So I find Peter's question completely appropriate while your response to
> > >
On Mon, Sep 5, 2022 at 1:12 AM Michal Hocko wrote:
>
> On Sun 04-09-22 18:32:58, Suren Baghdasaryan wrote:
> > On Thu, Sep 1, 2022 at 12:15 PM Michal Hocko wrote:
> [...]
> > > Yes, tracking back the call trace would be really needed. The question
> > > is whe
On Mon, Sep 5, 2022 at 1:58 AM Marco Elver wrote:
>
> On Mon, 5 Sept 2022 at 10:12, Michal Hocko wrote:
> > On Sun 04-09-22 18:32:58, Suren Baghdasaryan wrote:
> > > On Thu, Sep 1, 2022 at 12:15 PM Michal Hocko wrote:
> > [...]
> > > > Yes, tracking bac
On Mon, Sep 5, 2022 at 8:06 AM Steven Rostedt wrote:
>
> On Sun, 4 Sep 2022 18:32:58 -0700
> Suren Baghdasaryan wrote:
>
> > Page allocations (overheads are compared to get_free_pages() duration):
> > 6.8% Codetag counter manipulations (__lazy_percpu_counter_add +
>
On Tue, Sep 6, 2022 at 1:01 AM Michal Hocko wrote:
>
> On Mon 05-09-22 11:03:35, Suren Baghdasaryan wrote:
> > On Mon, Sep 5, 2022 at 1:12 AM Michal Hocko wrote:
> > >
> > > On Sun 04-09-22 18:32:58, Suren Baghdasaryan wrote:
> > > > On Thu, S
On Wed, Sep 7, 2022 at 11:35 PM Kent Overstreet
wrote:
>
> On Wed, Sep 07, 2022 at 09:45:18AM -0400, Steven Rostedt wrote:
> > On Wed, 7 Sep 2022 09:04:28 -0400
> > Kent Overstreet wrote:
> >
> > > On Wed, Sep 07, 2022 at 01:00:09PM +0200, Michal Hocko wrote:
> > > > Hmm, it seems that further di
To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(),
replace it with VM_LOCKED_MASK bitmask and convert all users.
Signed-off-by: Suren Baghdasaryan
---
include/linux/mm.h | 4 ++--
kernel/fork.c | 2 +-
mm/hugetlb.c | 4 ++--
mm/mlock.c | 6 +++---
mm/mmap.c
https://lore.kernel.org/all/20230109205336.3665937-1-sur...@google.com/
The patchset applies cleanly over mm-unstable branch of mm tree.
My apologies for an extremely large distribution list. The patch touches
lots of files and many are in arch/ and drivers/.
Suren Baghdasaryan (6):
mm: intr
are updated. This way we can better check and control correct
locking behavior during these updates.
Signed-off-by: Suren Baghdasaryan
---
include/linux/mm.h | 37 +
include/linux/mm_types.h | 8 +++-
2 files changed, 44 insertions(+), 1 deletion
Replace direct modifications to vma->vm_flags with calls to modifier
functions to be able to track flag changes and to keep vma locking
correctness.
Signed-off-by: Suren Baghdasaryan
---
arch/arm/kernel/process.c | 2 +-
arch/ia64/mm/ini
mmap_assert_write_locked() is used in vm_flags modifiers. Because
mmap_assert_write_locked() uses dump_mm() and vm_flags are sometimes
modified from from inside a module, it's necessary to export
dump_mm() function.
Signed-off-by: Suren Baghdasaryan
---
mm/debug.c | 1 +
1 file chang
mod_vm_flags_nolock for
flags modification and to avoid assertion.
Signed-off-by: Suren Baghdasaryan
---
arch/x86/mm/pat/memtype.c | 10 +++---
include/linux/mm.h| 12 +---
include/linux/pgtable.h | 5 +++--
mm/memory.c | 13 +++--
mm/memremap.c | 4
Replace indirect modifications to vma->vm_flags with calls to modifier
functions to be able to track flag changes and to keep vma locking
correctness. Add a BUG_ON check in ksm_madvise() to catch indirect
vm_flags modification attempts.
Signed-off-by: Suren Baghdasaryan
---
arch/powerpc/
On Wed, Jan 25, 2023 at 1:38 AM 'Michal Hocko' via kernel-team
wrote:
>
> On Wed 25-01-23 00:38:49, Suren Baghdasaryan wrote:
> > Replace indirect modifications to vma->vm_flags with calls to modifier
> > functions to be able to track flag changes and to keep vma
On Wed, Jan 25, 2023 at 10:37 AM Matthew Wilcox wrote:
>
> On Wed, Jan 25, 2023 at 08:49:50AM -0800, Suren Baghdasaryan wrote:
> > On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote:
> > > > + /*
> > > > + * Flags, see mm.h.
> > &g
On Wed, Jan 25, 2023 at 1:30 AM 'Michal Hocko' via kernel-team
wrote:
>
> On Wed 25-01-23 00:38:48, Suren Baghdasaryan wrote:
> > Replace direct modifications to vma->vm_flags with calls to modifier
> > functions to be able to track flag changes and to keep vma
On Wed, Jan 25, 2023 at 9:08 AM Michal Hocko wrote:
>
> On Wed 25-01-23 08:57:48, Suren Baghdasaryan wrote:
> > On Wed, Jan 25, 2023 at 1:38 AM 'Michal Hocko' via kernel-team
> > wrote:
> > >
> > > On Wed 25-01-23 00:38:49, Suren Baghdasaryan wrote:
On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote:
>
> On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote:
>
> > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> > index 2d6d790d9bed..6c7c70bf50dd 100644
> > --- a/include/linux/m
On Wed, Jan 25, 2023 at 1:42 AM Michal Hocko wrote:
>
> On Wed 25-01-23 00:38:50, Suren Baghdasaryan wrote:
> > In cases when VMA flags are modified after VMA was isolated and mmap_lock
> > was downgraded, flags modifications would result in an assertion because
> > mma
On Wed, Jan 25, 2023 at 10:33 AM Matthew Wilcox wrote:
>
> On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote:
> > +/* Use when VMA is not part of the VMA tree and needs no locking */
> > +static inline void init_vm_flags(struct v
On Thu, Jan 26, 2023 at 7:09 AM Matthew Wilcox wrote:
>
> On Thu, Jan 26, 2023 at 04:50:59PM +0200, Mike Rapoport wrote:
> > On Thu, Jan 26, 2023 at 11:17:09AM +0200, Mike Rapoport wrote:
> > > On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote:
> >
69 matches
Mail list logo