xt
mm: percpu: Add codetag reference into pcpuobj_ext
arm64: Fix circular header dependency
mm: vmalloc: Enable memory allocation profiling
rhashtable: Plumb through alloc tag
MAINTAINERS: Add entries for code tagging and memory allocation
profiling
Suren Baghdasaryan (23):
mm: enumer
From: Kent Overstreet
The new flags parameter allows controlling
- Whether or not the units suffix is separated by a space, for
compatibility with sort -h
- Whether or not to append a B suffix - we're not always printing
bytes.
Signed-off-by: Kent Overstreet
Signed-off-by:
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
Signed-off-by: Suren Baghdasaryan
---
scripts
From: Kent Overstreet
We're introducing alloc tagging, which tracks memory allocations by
callsite. Converting alloc_inode_sb() to a macro means allocations will
be tracked by its caller, which is a bit more useful.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasarya
eader dependency in the alloc tagging patch
series, and as a bonus should speed up kernel build times.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
Cc: Ingo Molnar
Cc: Peter Zijlstra
---
include/linux/nodemask.h | 2 +-
include/linux/nodemask_types.h | 9 +
in
From: Kent Overstreet
prandom.h doesn't use percpu.h - this fixes some circular header issues.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
include/linux/prandom.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/linux/prandom.h b/include/linux/pran
Introduce GFP bits enumeration to let compiler track the number of used
bits (which depends on the config options) instead of hardcoding them.
That simplifies __GFP_BITS_SHIFT calculation.
Suggested-by: Petr Tesařík
Signed-off-by: Suren Baghdasaryan
---
include/linux/gfp_types.h | 90
ure.
Signed-off-by: Suren Baghdasaryan
---
include/linux/memcontrol.h | 20 +++--
include/linux/mm_types.h | 4 +-
init/Kconfig | 4 +
mm/kfence/core.c | 14 ++--
mm/kfence/kfence.h | 4 +-
mm/memcontrol.c| 56 ++
mm/page_owne
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 | 11 +++
1 file changed, 11 insertions(+)
diff --git a/include/linux/gfp_types.h b/include/linux/gfp_types.h
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/slab.h| 6 ++
mm/slab_common.c | 2 ++
2 files changed, 8 insertions(+)
diff --git a/mm/slab.h b/mm
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
Introduce objext_flags to store additional objext flags unrelated to memcg.
Signed-off-by: Suren Baghdasaryan
---
include/linux/memcontrol.h | 29 ++---
mm/slab.h | 4 +---
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/include/linux
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 | 58
Skip freeing module's data section if there are non-zero allocation tags
because otherwise, once these allocations are freed, the access to their
code tag would cause UAF.
Signed-off-by: Suren Baghdasaryan
---
include/linux/codetag.h | 6 +++---
kernel/module/main.c
fault.
Co-developed-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
Signed-off-by: Kent Overstreet
---
Documentation/admin-guide/sysctl/vm.rst | 16 +++
Documentation/filesystems/proc.rst | 28 +
include/asm-generic/codetag.lds.h | 14 +++
include/asm-generic/vml
Introduce helper functions to easily instrument page allocators by
storing a pointer to the allocation tag associated with the code that
allocated the page in a page_ext field.
Signed-off-by: Suren Baghdasaryan
Co-developed-by: Kent Overstreet
Signed-off-by: Kent Overstreet
---
include/linux
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
From: Kent Overstreet
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: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
drivers/accel/ivpu/ivpu_
When a high-order page is split into smaller ones, each newly split
page should get its codetag. The original codetag is reused for these
pages but it's recorded as 0-byte allocation because original codetag
already accounts for the original high-order allocated page.
Signed-off-by:
Redefine page allocators to record allocation tags upon their invocation.
Instrument post_alloc_hook and free_pages_prepare to modify current
allocation tag.
Co-developed-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
Signed-off-by: Kent Overstreet
---
include/linux/alloc_tag.h | 10
we enable it only when debugging
with CONFIG_MEM_ALLOC_PROFILING_DEBUG enabled and not universally for
CONFIG_MEM_ALLOC_PROFILING.
Signed-off-by: Suren Baghdasaryan
---
mm/page_ext.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/mm/page_ext.c b/mm/page_ext.c
index 3c58fe8a24df
To store code tag for every slab object, a codetag reference is embedded
into slabobj_ext when CONFIG_MEM_ALLOC_PROFILING=y.
Signed-off-by: Suren Baghdasaryan
Co-developed-by: Kent Overstreet
Signed-off-by: Kent Overstreet
---
include/linux/memcontrol.h | 5 +
lib/Kconfig.debug
Account slab allocations using codetag reference embedded into slabobj_ext.
Signed-off-by: Suren Baghdasaryan
Co-developed-by: Kent Overstreet
Signed-off-by: Kent Overstreet
---
include/linux/slab_def.h | 2 +-
include/linux/slub_def.h | 4 ++--
mm/slab.c| 4 +++-
mm/slab.h
From: Kent Overstreet
It seems we need to be more forceful with the compiler on this one.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slub.c b/mm/slub.c
index f5e07d8802e2..222c16cef729
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/fortify-string.h | 5 +-
include/linux/slab.h
.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
include/linux/mempool.h | 73 -
mm/mempool.c| 34 ---
2 files changed, 48 insertions(+), 59 deletions(-)
diff --git a/include/linux/mempool.h b/include/linux
From: Kent Overstreet
This adds an alloc_hooks() wrapper around kmem_alloc(), so that we can
have allocations accounted to the proper callsite.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
fs/xfs/kmem.c | 4 ++--
fs/xfs/kmem.h | 10 --
2 files changed, 6
patch - similarly to the
previous slabobj_ext patch.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
Cc: Andrew Morton
Cc: Dennis Zhou
Cc: Tejun Heo
Cc: Christoph Lameter
Cc: linux...@kvack.org
---
mm/percpu-internal.h | 19 +--
mm/percpu.c | 30
From: Kent Overstreet
This avoids a circular header dependency in an upcoming patch by only
making hrtimer.h depend on percpu-defs.h
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
Cc: Thomas Gleixner
---
include/linux/hrtimer.h| 2 +-
include/linux/time_namespace.h
Redefine __alloc_percpu, __alloc_percpu_gfp and __alloc_reserved_percpu
to record allocations and deallocations done by these functions.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 15 +
include/linux/percpu.h| 23
From: Kent Overstreet
To store codetag for every per-cpu allocation, a codetag reference is
embedded into pcpuobj_ext when CONFIG_MEM_ALLOC_PROFILING=y. Hooks to
use the newly introduced codetag are added.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
mm/percpu
From: Kent Overstreet
Replace linux/percpu.h include with asm/percpu.h to avoid circular
dependency.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
arch/arm64/include/asm/spectre.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64
Include allocations in show_mem reports.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 2 ++
lib/alloc_tag.c | 37 +
mm/show_mem.c | 15 +++
3 files changed, 54 insertions
From: Kent Overstreet
This wrapps all external vmalloc allocation functions with the
alloc_hooks() wrapper, and switches internal allocations to _noprof
variants where appropriate, for the new memory allocation profiling
feature.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
From: Kent Overstreet
This gives better memory allocation profiling results; rhashtable
allocations will be accounted to the code that initialized the
rhashtable.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
include/linux/rhashtable-types.h | 11 +--
lib
. Introduce CODETAG_EMPTY special codetag value to mark
allocations which intentionally lack codetag to avoid these warnings.
Set objext codetags to CODETAG_EMPTY before freeing to indicate that
the codetag is expected to be empty.
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h
a new objext_flags flag
stored in the lower bits of slab->obj_exts. When new allocation succeeds
it marks all tag references in the same slabobj_ext vector as empty to
avoid warnings implemented by CONFIG_MEM_ALLOC_PROFILING_DEBUG checks.
Signed-off-by: Suren Baghdasaryan
---
include/li
From: Kent Overstreet
The new code & libraries added are being maintained - mark them as such.
Signed-off-by: Kent Overstreet
Signed-off-by: Suren Baghdasaryan
---
MAINTAINERS | 16
1 file changed, 16 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 2894f077
To avoid debug warnings while freeing reserved pages which were not
allocated with usual allocators, mark their codetags as empty before
freeing.
Maybe we can annotate reserved pages correctly and avoid this?
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 2 ++
include
On Tue, Oct 24, 2023 at 11:29 AM Roman Gushchin
wrote:
>
> On Tue, Oct 24, 2023 at 06:45:57AM -0700, Suren Baghdasaryan wrote:
> > Updates since the last version [1]
> > - Simplified allocation tagging macros;
> > - Runtime enable/disable sysctl switch (/proc/sys/vm/mem_p
On Tue, Oct 24, 2023 at 10:47 PM Petr Tesařík wrote:
>
> On Tue, 24 Oct 2023 06:46:03 -0700
> Suren Baghdasaryan wrote:
>
> > Introduce GFP bits enumeration to let compiler track the number of used
> > bits (which depends on the config options) instead of hardcoding t
On Wed, Oct 25, 2023 at 5:33 PM Thomas Gleixner wrote:
>
> On Tue, Oct 24 2023 at 06:46, Suren Baghdasaryan wrote:
> > From: Kent Overstreet
> >
> > This avoids a circular header dependency in an upcoming patch by only
> > making hrtimer.h depend on percpu-defs.h
&g
On Mon, Mar 25, 2024 at 10:49 AM SeongJae Park wrote:
>
> On Mon, 25 Mar 2024 14:56:01 + Suren Baghdasaryan
> wrote:
>
> > On Sat, Mar 23, 2024 at 6:05 PM SeongJae Park wrote:
> > >
> > > Hi Suren and Kent,
> > >
> > > On Thu, 21 Ma
On Mon, Mar 25, 2024 at 11:20 AM SeongJae Park wrote:
>
> On Mon, 25 Mar 2024 10:59:01 -0700 Suren Baghdasaryan
> wrote:
>
> > On Mon, Mar 25, 2024 at 10:49 AM SeongJae Park wrote:
> > >
> > > On Mon, 25 Mar 2024 14:56:01 + Suren Baghdasaryan
>
inside
page flags if they fit.
Patchset applies to mm-unstable.
Suren Baghdasaryan (5):
alloc_tag: load module tags into separate continuous memory
alloc_tag: eliminate alloc_tag_ref_set
alloc_tag: introduce pgalloc_tag_ref to abstract page tag references
alloc_tag: make page allocation tag
dule_alloc_tags kernel
parameter is introduced to change this size.
Signed-off-by: Suren Baghdasaryan
---
.../admin-guide/kernel-parameters.txt | 4 +
include/asm-generic/codetag.lds.h | 19 ++
include/linux/alloc_tag.h | 13 +-
include/
To simplify further refactoring, open-code the only two callers
of alloc_tag_ref_set().
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 25 ++---
include/linux/pgalloc_tag.h | 12 +++-
2 files changed, 13 insertions(+), 24 deletions(-)
diff --git
To simplify later changes to page tag references, introduce new
pgalloc_tag_ref and pgtag_ref_handle types. This allows easy
replacement of page_ext as a storage of page allocation tags
Signed-off-by: Suren Baghdasaryan
---
include/linux/pgalloc_tag.h | 144
Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the
page allocation tag references. When the size is configured to be
less than a direct pointer, the tags are searched using an index
stored as the tag reference.
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 10
required
to be available in the page flags to store the references. If the
number of page flag bits is insufficient, the build will fail and
either CONFIG_PGALLOC_TAG_REF_BITS would have to be lowered or
CONFIG_PGALLOC_TAG_USE_PAGEFLAGS should be disabled.
Signed-off-by: Suren Baghdasaryan
---
include
On Mon, Aug 19, 2024 at 12:34 PM Matthew Wilcox wrote:
>
> On Mon, Aug 19, 2024 at 08:15:11AM -0700, Suren Baghdasaryan wrote:
> > @@ -91,7 +97,7 @@
> > #endif
> >
> > #if ZONES_WIDTH + LRU_GEN_WIDTH + SECTIONS_WIDTH + NODES_WIDTH + \
> > -
On Mon, Aug 19, 2024 at 6:46 PM Andrew Morton wrote:
>
> On Mon, 19 Aug 2024 21:40:34 +0100 Matthew Wilcox wrote:
>
> > On Mon, Aug 19, 2024 at 01:39:16PM -0700, Suren Baghdasaryan wrote:
> > > On Mon, Aug 19, 2024 at 12:34 PM Matthew Wilcox
> > > wrote:
>
On Tue, Aug 20, 2024 at 12:13 AM Mike Rapoport wrote:
>
> On Mon, Aug 19, 2024 at 08:15:07AM -0700, Suren Baghdasaryan wrote:
> > When a module gets unloaded there is a possibility that some of the
> > allocations it made are still used and therefore the allocation tags
> >
On Tue, Aug 20, 2024 at 8:31 AM 'Liam R. Howlett' via kernel-team
wrote:
>
> * Suren Baghdasaryan [240819 11:15]:
> > When a module gets unloaded there is a possibility that some of the
> > allocations it made are still used and therefore the allocation tag
required
to be available in the page flags to store the references. If the
number of page flag bits is insufficient, the build will fail and
either CONFIG_PGALLOC_TAG_REF_BITS would have to be lowered or
CONFIG_PGALLOC_TAG_USE_PAGEFLAGS should be disabled.
Signed-off-by: Suren Baghdasaryan
---
include
Add mas_for_each_rev() function to iterate maple tree nodes in reverse
order.
Suggested-by: Liam R. Howlett
Signed-off-by: Suren Baghdasaryan
---
include/linux/maple_tree.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/include/linux/maple_tree.h b/include/linux
dule_alloc_tags kernel
parameter is introduced to change this size.
Signed-off-by: Suren Baghdasaryan
---
.../admin-guide/kernel-parameters.txt | 4 +
include/asm-generic/codetag.lds.h | 19 ++
include/linux/alloc_tag.h | 13 +-
include/
Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the
page allocation tag references. When the size is configured to be
less than a direct pointer, the tags are searched using an index
stored as the tag reference.
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 10
To simplify further refactoring, open-code the only two callers
of alloc_tag_ref_set().
Signed-off-by: Suren Baghdasaryan
---
include/linux/alloc_tag.h | 25 ++---
include/linux/pgalloc_tag.h | 12 +++-
2 files changed, 13 insertions(+), 24 deletions(-)
diff --git
configuration build, per kernel test robot
[1] https://lore.kernel.org/all/20240819151512.2363698-1-sur...@google.com/
Suren Baghdasaryan (6):
maple_tree: add mas_for_each_rev() helper
alloc_tag: load module tags into separate continuous memory
alloc_tag: eliminate alloc_tag_ref_set
alloc_tag
To simplify later changes to page tag references, introduce new
pgalloc_tag_ref and pgtag_ref_handle types. This allows easy
replacement of page_ext as a storage of page allocation tags
Signed-off-by: Suren Baghdasaryan
---
include/linux/pgalloc_tag.h | 144
On Sun, Sep 1, 2024 at 10:16 PM Andrew Morton wrote:
>
> On Sun, 1 Sep 2024 21:41:28 -0700 Suren Baghdasaryan
> wrote:
>
> > Add CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to store allocation tag
> > references directly in the page flags. This removes dependency on
> >
On Sun, Sep 1, 2024 at 10:09 PM Andrew Morton wrote:
>
> On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan
> wrote:
>
> > Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the
> > page allocation tag references. When the size is configured to be
> &
On Tue, Sep 3, 2024 at 6:17 PM Kent Overstreet
wrote:
>
> On Tue, Sep 03, 2024 at 06:07:28PM GMT, Suren Baghdasaryan wrote:
> > On Sun, Sep 1, 2024 at 10:09 PM Andrew Morton
> > wrote:
> > >
> > > On Sun, 1 Sep 2024 21:41:27 -0700 Suren Baghdasaryan
On Tue, Sep 3, 2024 at 7:06 PM 'John Hubbard' via kernel-team
wrote:
>
> On 9/3/24 6:25 PM, John Hubbard wrote:
> > On 9/3/24 11:19 AM, Suren Baghdasaryan wrote:
> >> On Sun, Sep 1, 2024 at 10:16 PM Andrew Morton
> >> wrote:
> >>> O
On Tue, Sep 3, 2024 at 7:19 PM Matthew Wilcox wrote:
>
> On Tue, Sep 03, 2024 at 06:25:52PM -0700, John Hubbard wrote:
> > The more I read this story, the clearer it becomes that this should be
> > entirely done by the build system: set it, or don't set it, automatically.
> >
> > And if you can ma
On Wed, Sep 4, 2024 at 9:25 AM Kent Overstreet
wrote:
>
> On Tue, Sep 03, 2024 at 07:04:51PM GMT, Suren Baghdasaryan wrote:
> > On Tue, Sep 3, 2024 at 6:17 PM Kent Overstreet
> > wrote:
> > >
> > > On Tue, Sep 03, 2024 at 06:07:28PM GMT, Suren Baghdasaryan w
On Wed, Sep 4, 2024 at 9:37 AM Kent Overstreet
wrote:
>
> On Wed, Sep 04, 2024 at 05:35:49PM GMT, Matthew Wilcox wrote:
> > On Wed, Sep 04, 2024 at 09:18:01AM -0700, Suren Baghdasaryan wrote:
> > > I'm not sure I understand your suggestion, Matthew. We allocate a
>
On Wed, Sep 4, 2024 at 11:58 AM 'John Hubbard' via kernel-team
wrote:
>
> On 9/4/24 9:08 AM, Suren Baghdasaryan wrote:
> > On Tue, Sep 3, 2024 at 7:06 PM 'John Hubbard' via kernel-team
> > wrote:
> >> On 9/3/24 6:25 PM, John Hubbard wrote:
>
thread's scheduling policy is an implementation detail and should not be
exposed to the user level. Remove the permission check by using _nocheck
version of the function.
Suggested-by: Nick Kralevich
Signed-off-by: Suren Baghdasaryan
---
kernel/sched/psi.c | 2 +-
1 file changed, 1 insertion(
On Mon, Jul 29, 2019 at 12:57 PM Greg KH wrote:
>
> On Mon, Jul 29, 2019 at 12:42:05PM -0700, Suren Baghdasaryan wrote:
> > When a process creates a new trigger by writing into /proc/pressure/*
> > files, permissions to write such a file should be used to determine whether
thread's scheduling policy is an implementation detail and should not be
exposed to the user level. Remove the permission check by using _nocheck
version of the function.
Suggested-by: Nick Kralevich
Signed-off-by: Suren Baghdasaryan
---
kernel/sched/psi.c | 2 +-
1 file changed, 1 insertion(
On Tue, Jul 30, 2019 at 1:11 AM Peter Zijlstra wrote:
>
> On Mon, Jul 29, 2019 at 06:33:10PM -0700, Suren Baghdasaryan wrote:
> > When a process creates a new trigger by writing into /proc/pressure/*
> > files, permissions to write such a file should be used to determine wheth
things in life. I checked and your proposal to change
it to FIFO-1 should still work for our purposes. Will test to make
sure and reply to your patch. Couple clarifications in-line.
On Thu, Aug 1, 2019 at 2:51 AM Peter Zijlstra wrote:
>
> On Tue, Jul 30, 2019 at 10:44:51AM -0700, Suren Baghda
On Thu, Aug 1, 2019 at 2:59 PM Peter Zijlstra wrote:
>
> On Thu, Aug 01, 2019 at 11:28:30AM -0700, Suren Baghdasaryan wrote:
> > > By marking it FIFO-99 you're in effect saying that your stupid
> > > statistics gathering is more important than your life. It will pre
into psi_group_cpu struct which results
in its first cacheline-aligned part becoming 52 bytes long. Add explicit
values to enumeration element counters that affect psi_group_cpu struct
size.
Link: http://lkml.kernel.org/r/20190124211518.244221-4-sur...@google.com
Signed-off-by: Suren Baghdasaryan
Renaming psi_group structure member fields used for calculating psi totals
and averages for clear distinction between them and trigger-related fields
that will be added next.
Signed-off-by: Suren Baghdasaryan
---
include/linux/psi_types.h | 14 ++---
kernel/sched/psi.c| 41
/deactivations when psi
signal is bouncing.
Notifications to the users are rate-limited to one per tracking window.
Signed-off-by: Suren Baghdasaryan
Signed-off-by: Johannes Weiner
---
Documentation/accounting/psi.txt | 107 +++
include/linux/psi.h | 8 +
include/linux
psi_enable is not used outside of psi.c, make it static.
Suggested-by: Andrew Morton
Signed-off-by: Suren Baghdasaryan
---
kernel/sched/psi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 22c1505ad290..281702de9772 100644
Introduce changed_states parameter into collect_percpu_times to track
the states changed since the last update.
Signed-off-by: Suren Baghdasaryan
---
kernel/sched/psi.c | 24 ++--
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/psi.c b/kernel
Split update_stats into collect_percpu_times and update_averages for
collect_percpu_times to be reused later inside psi monitor.
Signed-off-by: Suren Baghdasaryan
---
kernel/sched/psi.c | 55 +++---
1 file changed, 32 insertions(+), 23 deletions(-)
diff
m the
headers included from kthread.h.
Signed-off-by: Suren Baghdasaryan
---
include/linux/kthread.h | 3 ++-
include/linux/sched.h | 1 -
kernel/kthread.c| 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 2c89e60
for
short intervals, and hooks up write() and poll() on the pressure files.
The patches were developed in collaboration with Johannes Weiner.
The patches are based on 5.0-rc8 (Merge tag 'drm-next-2019-03-06').
Suren Baghdasaryan (7):
psi: introduce state_mask to represent stalled psi
ed in collaboration with Johannes Weiner.
The patches are based on 4.20-rc6.
Johannes Weiner (3):
fs: kernfs: add poll file operation
kernel: cgroup: add poll file operation
psi: eliminate lazy clock mode
Suren Baghdasaryan (3):
psi: introduce state_mask to represent stalled psi s
duration of one
tracking window to avoid repeated activations/deactivations when psi
signal is bouncing.
Notifications to the users are rate-limited to one per tracking window.
Signed-off-by: Suren Baghdasaryan
---
Documentation/accounting/psi.txt | 105 +++
include/linux/psi.h | 10
have
per-fd trigger configurations.
Signed-off-by: Johannes Weiner
Signed-off-by: Suren Baghdasaryan
---
fs/kernfs/file.c | 31 ---
include/linux/kernfs.h | 6 ++
2 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/fs/kernfs/file.c b/fs/kernfs
The psi monitoring patches will need to determine the same states as
record_times(). To avoid calculating them twice, maintain a state mask
that can be consulted cheaply. Do this in a separate patch to keep the
churn in the main feature patch at a minimum.
Signed-off-by: Suren Baghdasaryan
have
per-fd trigger configurations.
Signed-off-by: Johannes Weiner
Signed-off-by: Suren Baghdasaryan
---
include/linux/cgroup-defs.h | 4
kernel/cgroup/cgroup.c | 12
2 files changed, 16 insertions(+)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
Renaming psi_group structure member fields used for calculating psi
totals and averages for clear distinction between them and trigger-related
fields that will be added next.
Signed-off-by: Suren Baghdasaryan
---
include/linux/psi_types.h | 15 ---
kernel/sched/psi.c| 26
Signed-off-by: Suren Baghdasaryan
---
kernel/sched/psi.c | 55 +++---
1 file changed, 22 insertions(+), 33 deletions(-)
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index fe24de3fbc93..d2b9c9a1a62f 100644
--- a/kernel/sched/psi.c
+++ b/kernel/s
On Mon, Dec 17, 2018 at 6:58 AM Peter Zijlstra wrote:
>
> On Fri, Dec 14, 2018 at 09:15:05AM -0800, Suren Baghdasaryan wrote:
> > Eliminate the idle mode and keep the worker doing 2s update intervals
> > at all times.
>
> That sounds like a bad deal.. esp. so for batt
On Mon, Dec 17, 2018 at 7:55 AM Peter Zijlstra wrote:
>
> On Fri, Dec 14, 2018 at 09:15:06AM -0800, Suren Baghdasaryan wrote:
> > The psi monitoring patches will need to determine the same states as
> > record_times(). To avoid calculating them twice, maintain a state ma
On Mon, Dec 17, 2018 at 8:22 AM Peter Zijlstra wrote:
>
> On Fri, Dec 14, 2018 at 09:15:08AM -0800, Suren Baghdasaryan wrote:
> > +ssize_t psi_trigger_parse(char *buf, size_t nbytes, enum psi_res res,
> > + enum psi_states *state, u32 *threshold_us, u32 *win_sz_us)
> >
On Mon, Dec 17, 2018 at 8:37 AM Peter Zijlstra wrote:
>
> On Fri, Dec 14, 2018 at 09:15:08AM -0800, Suren Baghdasaryan wrote:
> > @@ -358,28 +526,23 @@ static void psi_update_work(struct work_struct *work)
> > {
> > struct delayed_work *dwork;
> >
2018 at 9:30 AM Johannes Weiner wrote:
>
> On Tue, Dec 18, 2018 at 11:46:22AM +0100, Peter Zijlstra wrote:
> > On Mon, Dec 17, 2018 at 05:21:05PM -0800, Suren Baghdasaryan wrote:
> > > On Mon, Dec 17, 2018 at 8:22 AM Peter Zijlstra
> > > wrote:
> >
> > > >
On Tue, Dec 18, 2018 at 11:18 AM Joel Fernandes wrote:
>
> On Tue, Dec 18, 2018 at 9:58 AM 'Suren Baghdasaryan' via kernel-team
> wrote:
> >
> > Current design supports only whole percentages and if userspace needs
> > more granularity then it has to us
psi_group_cpu struct which
results in its first cacheline-aligned part to become 52 bytes long.
Add explicit values to enumeration element counters that affect
psi_group_cpu struct size.
Signed-off-by: Suren Baghdasaryan
---
include/linux/psi_types.h | 9 ++---
kernel/sched/psi.c| 29
Renaming psi_group structure member fields used for calculating psi
totals and averages for clear distinction between them and trigger-related
fields that will be added next.
Signed-off-by: Suren Baghdasaryan
---
include/linux/psi_types.h | 15 ---
kernel/sched/psi.c| 26
have
per-fd trigger configurations.
Signed-off-by: Johannes Weiner
Signed-off-by: Suren Baghdasaryan
---
include/linux/cgroup-defs.h | 4
kernel/cgroup/cgroup.c | 12
2 files changed, 16 insertions(+)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
1 - 100 of 153 matches
Mail list logo