Re: [PATCH v2] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
On 4/20/21 4:48 PM, Daniel Stone wrote: > On Tue, 20 Apr 2021 at 14:46, > wrote: > > On 4/20/21 3:34 PM, Daniel Stone wrote: > > On Fri, 16 Apr 2021 at 13:34, Peter Enderborg

Re: [PATCH v2] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
On 4/20/21 3:34 PM, Daniel Stone wrote: > Hi Peter, > > On Fri, 16 Apr 2021 at 13:34, Peter Enderborg > wrote: > > This adds a total used dma-buf memory. Details > can be found in debugfs, however it is not for everyone > and not always available.

Re: [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
On 4/20/21 1:52 PM, Mike Rapoport wrote: > On Tue, Apr 20, 2021 at 10:45:21AM +, peter.enderb...@sony.com wrote: >> On 4/20/21 11:41 AM, Mike Rapoport wrote: >>> Hello Peter, >>> >>> On Tue, Apr 20, 2021 at 09:26:00AM +, peter.enderb...@sony.com wrote: On 4/20/21 10:58 AM, Daniel

Re: [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
On 4/20/21 1:14 PM, Daniel Vetter wrote: > On Tue, Apr 20, 2021 at 09:26:00AM +, peter.enderb...@sony.com wrote: >> On 4/20/21 10:58 AM, Daniel Vetter wrote: >>> On Sat, Apr 17, 2021 at 06:38:35PM +0200, Peter Enderborg wrote: This adds a total used dma-buf memory. Details can be

Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
On 4/20/21 1:04 PM, Michal Hocko wrote: > On Tue 20-04-21 09:25:51, peter.enderb...@sony.com wrote: >> On 4/20/21 11:12 AM, Michal Hocko wrote: >>> On Tue 20-04-21 09:02:57, peter.enderb...@sony.com wrote: >> But that isn't really system memory at all, it's just allocated device >> memory.

Re: [PATCH v5] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
On 4/20/21 10:58 AM, Daniel Vetter wrote: > On Sat, Apr 17, 2021 at 06:38:35PM +0200, Peter Enderborg wrote: >> This adds a total used dma-buf memory. Details >> can be found in debugfs, however it is not for everyone >> and not always available. dma-buf are indirect allocated by >> userspace. So

Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
On 4/20/21 11:12 AM, Michal Hocko wrote: > On Tue 20-04-21 09:02:57, peter.enderb...@sony.com wrote: But that isn't really system memory at all, it's just allocated device memory. >>> OK, that was not really clear to me. So this is not really accounted to >>> MemTotal? If that is really

Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-20 Thread Peter.Enderborg
>> But that isn't really system memory at all, it's just allocated device >> memory. > OK, that was not really clear to me. So this is not really accounted to > MemTotal? If that is really the case then reporting it into the oom > report is completely pointless and I am not even sure

Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-19 Thread Peter.Enderborg
On 4/19/21 5:00 PM, Michal Hocko wrote: > On Mon 19-04-21 12:41:58, peter.enderb...@sony.com wrote: >> On 4/19/21 2:16 PM, Michal Hocko wrote: >>> On Sat 17-04-21 12:40:32, Peter Enderborg wrote: This adds a total used dma-buf memory. Details can be found in debugfs, however it is not

Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-19 Thread Peter.Enderborg
On 4/19/21 2:16 PM, Michal Hocko wrote: > On Sat 17-04-21 12:40:32, Peter Enderborg wrote: >> This adds a total used dma-buf memory. Details >> can be found in debugfs, however it is not for everyone >> and not always available. dma-buf are indirect allocated by >> userspace. So with this value we

Re: [External] [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-17 Thread Peter.Enderborg
On 4/17/21 3:07 PM, Muchun Song wrote: > On Sat, Apr 17, 2021 at 6:41 PM Peter Enderborg > wrote: >> This adds a total used dma-buf memory. Details >> can be found in debugfs, however it is not for everyone >> and not always available. dma-buf are indirect allocated by >> userspace. So with this

Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-17 Thread Peter.Enderborg
On 4/17/21 1:54 PM, Christian König wrote: > Am 17.04.21 um 13:20 schrieb peter.enderb...@sony.com: >> On 4/17/21 12:59 PM, Christian König wrote: >>> Am 17.04.21 um 12:40 schrieb Peter Enderborg: This adds a total used dma-buf memory. Details can be found in debugfs, however it is not

Re: [PATCH v4] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-17 Thread Peter.Enderborg
On 4/17/21 12:59 PM, Christian König wrote: > Am 17.04.21 um 12:40 schrieb Peter Enderborg: >> This adds a total used dma-buf memory. Details >> can be found in debugfs, however it is not for everyone >> and not always available. dma-buf are indirect allocated by >> userspace. So with this value

Re: [External] [PATCH v3] dma-buf: Add DmaBufTotal counter in meminfo

2021-04-17 Thread Peter.Enderborg
On 4/17/21 5:05 AM, Muchun Song wrote: > On Sat, Apr 17, 2021 at 12:08 AM Peter Enderborg > wrote: >> This adds a total used dma-buf memory. Details >> can be found in debugfs, however it is not for everyone >> and not always available. dma-buf are indirect allocated by >> userspace. So with this

Re: [PATCH] debugfs: Make debugfs_allow RO after init

2021-04-06 Thread Peter.Enderborg
On 4/5/21 11:39 PM, Kees Cook wrote: > Since debugfs_allow is only set at boot time during __init, make it > read-only after being set. > > Cc: Peter Enderborg > Fixes: a24c6f7bc923 ("debugfs: Add access restriction option") > Signed-off-by: Kees Cook > --- > fs/debugfs/inode.c | 2 +- > 1 file

[PATCH v2 2/5] selinux: Move policydb to pointer structure

2018-01-26 Thread peter.enderborg
From: Peter Enderborg To be able to use rcu locks we seed to address the policydb though a pointer. This patch adds a pointer structure to repleace the static policydb. Signed-off-by: Peter Enderborg --- security/selinux/ss/services.c | 274

[PATCH v2 2/5] selinux: Move policydb to pointer structure

2018-01-26 Thread peter.enderborg
From: Peter Enderborg To be able to use rcu locks we seed to address the policydb though a pointer. This patch adds a pointer structure to repleace the static policydb. Signed-off-by: Peter Enderborg --- security/selinux/ss/services.c | 274 ++--- 1 file

[PATCH v2 1/5] selinux:Remove direct references to policydb.

2018-01-26 Thread peter.enderborg
From: Peter Enderborg To be able to use rcu locks we seed to address the policydb though a pointer. This preparation removes the export of the policydb and send pointers to it through parameter agruments. Signed-off-by: Peter Enderborg ---

[PATCH v2 1/5] selinux:Remove direct references to policydb.

2018-01-26 Thread peter.enderborg
From: Peter Enderborg To be able to use rcu locks we seed to address the policydb though a pointer. This preparation removes the export of the policydb and send pointers to it through parameter agruments. Signed-off-by: Peter Enderborg --- security/selinux/ss/mls.c | 69

[PATCH v2 5/5] selinux: Switch locking to RCU.

2018-01-26 Thread peter.enderborg
From: Peter Enderborg This patch switch to using RCU locks instead of rwlocks. This has the big advantage that it does not has preempt disable. Signed-off-by: Peter Enderborg Reported-by: Björn Davidsson ---

[PATCH v2 5/5] selinux: Switch locking to RCU.

2018-01-26 Thread peter.enderborg
From: Peter Enderborg This patch switch to using RCU locks instead of rwlocks. This has the big advantage that it does not has preempt disable. Signed-off-by: Peter Enderborg Reported-by: Björn Davidsson --- security/selinux/ss/services.c | 162 + 1

[PATCH v2 0/5] selinux:Significant reduce of preempt_disable holds

2018-01-26 Thread peter.enderborg
Holding the preempt_disable is very bad for low latency tasks as audio and therefore we need to break out the rule-set dependent part from this disable. By using a RCU instead of rwlock we have an efficient locking and less preemption interference. Selinux uses a lot of read_locks. This patch

[PATCH v2 3/5] selinux: Move sidtab to pointer structure

2018-01-26 Thread peter.enderborg
From: Peter Enderborg To be able to use rcu locks we need access the sidtab trough a pointer. This moves the sittab to a dynamic allocated struture. Signed-off-by: Peter Enderborg --- security/selinux/ss/services.c | 140

[PATCH v2 4/5] selinux: Use pointer to switch policydb and sidtab

2018-01-26 Thread peter.enderborg
From: Peter Enderborg This i preparation for switching to RCU locks. To be able to use RCU we need atomic switched pointer. This adds the dynamic memory copying to be a single pointer. It copy all the data structures in to new ones. This is an overhead for writing rules

[PATCH v2 0/5] selinux:Significant reduce of preempt_disable holds

2018-01-26 Thread peter.enderborg
Holding the preempt_disable is very bad for low latency tasks as audio and therefore we need to break out the rule-set dependent part from this disable. By using a RCU instead of rwlock we have an efficient locking and less preemption interference. Selinux uses a lot of read_locks. This patch

[PATCH v2 3/5] selinux: Move sidtab to pointer structure

2018-01-26 Thread peter.enderborg
From: Peter Enderborg To be able to use rcu locks we need access the sidtab trough a pointer. This moves the sittab to a dynamic allocated struture. Signed-off-by: Peter Enderborg --- security/selinux/ss/services.c | 140 ++--- 1 file changed, 74

[PATCH v2 4/5] selinux: Use pointer to switch policydb and sidtab

2018-01-26 Thread peter.enderborg
From: Peter Enderborg This i preparation for switching to RCU locks. To be able to use RCU we need atomic switched pointer. This adds the dynamic memory copying to be a single pointer. It copy all the data structures in to new ones. This is an overhead for writing rules but the benifit is RCU.

[PATCH] selinux:Significant reduce of preempt_disable holds

2018-01-17 Thread peter.enderborg
From: Peter Enderborg Holding the preempt_disable is very bad for low latency tasks as audio and therefore we need to break out the rule-set dependent part from this disable. By using a rwsem instead of rwlock we have an efficient locking and less preemption

[PATCH] selinux:Significant reduce of preempt_disable holds

2018-01-17 Thread peter.enderborg
From: Peter Enderborg Holding the preempt_disable is very bad for low latency tasks as audio and therefore we need to break out the rule-set dependent part from this disable. By using a rwsem instead of rwlock we have an efficient locking and less preemption interference. Selinux uses a lot of

[PATCH] Add slowpath enter/exit trace events

2017-11-23 Thread peter.enderborg
From: Peter Enderborg The warning of slow allocation has been removed, this is a other way to fetch that information. But you need to enable the trace. The exit function also returns information about the number of retries, how long it was stalled and failure reason if

[PATCH] Add slowpath enter/exit trace events

2017-11-23 Thread peter.enderborg
From: Peter Enderborg The warning of slow allocation has been removed, this is a other way to fetch that information. But you need to enable the trace. The exit function also returns information about the number of retries, how long it was stalled and failure reason if that happened.

[PATCH 3/3 staging-next] mm: Remove RCU and tasklocks from lmk

2017-02-14 Thread peter.enderborg
From: Peter Enderborg Fundamental changes: 1 Does NOT take any RCU lock in shrinker functions. 2 It returns same result for scan and counts, so we dont need to do shinker will know when it is pointless to call scan. 3 It does not lock any other process than the

[PATCH 3/3 staging-next] mm: Remove RCU and tasklocks from lmk

2017-02-14 Thread peter.enderborg
From: Peter Enderborg Fundamental changes: 1 Does NOT take any RCU lock in shrinker functions. 2 It returns same result for scan and counts, so we dont need to do shinker will know when it is pointless to call scan. 3 It does not lock any other process than the one that is going to be

[PATCH 2/3 staging-next] oom: Add notification for oom_score_adj

2017-02-14 Thread peter.enderborg
From: Peter Enderborg This adds subscribtion for changes in oom_score_adj, this value is important to android systems. For task that uses oom_score_adj they read the task list. This can be long and need rcu locks and has a impact on the system. Let the user track

[PATCH 2/3 staging-next] oom: Add notification for oom_score_adj

2017-02-14 Thread peter.enderborg
From: Peter Enderborg This adds subscribtion for changes in oom_score_adj, this value is important to android systems. For task that uses oom_score_adj they read the task list. This can be long and need rcu locks and has a impact on the system. Let the user track the changes based on

[PATCH 1/3 staging-next] android: Collect statistics from lowmemorykiller

2017-02-14 Thread peter.enderborg
From: Peter Enderborg This collects stats for shrinker calls and how much waste work we do within the lowmemorykiller. Signed-off-by: Peter Enderborg --- drivers/staging/android/Kconfig | 11

[PATCH 1/3 staging-next] android: Collect statistics from lowmemorykiller

2017-02-14 Thread peter.enderborg
From: Peter Enderborg This collects stats for shrinker calls and how much waste work we do within the lowmemorykiller. Signed-off-by: Peter Enderborg --- drivers/staging/android/Kconfig | 11 drivers/staging/android/Makefile| 1 +