Re: [GIT PULL] Modules changes for v6.7-rc1

2023-11-02 Thread Andrea Righi
On Thu, Nov 02, 2023 at 08:29:17AM +0100, Andrea Righi wrote: > On Wed, Nov 01, 2023 at 09:21:09PM -1000, Linus Torvalds wrote: > > On Wed, 1 Nov 2023 at 21:02, Linus Torvalds > > wrote: > > > > > > kmalloc() isn't just about "use physically contiguous all

Re: [GIT PULL] Modules changes for v6.7-rc1

2023-11-02 Thread Andrea Righi
On Wed, Nov 01, 2023 at 09:21:09PM -1000, Linus Torvalds wrote: > On Wed, 1 Nov 2023 at 21:02, Linus Torvalds > wrote: > > > > kmalloc() isn't just about "use physically contiguous allocations". > > It's also more memory-efficient, and a *lot* faster than vmalloc(), > > which has to play VM

Re: [GIT PULL] Modules changes for v6.7-rc1

2023-11-02 Thread Andrea Righi
On Wed, Nov 01, 2023 at 09:02:51PM -1000, Linus Torvalds wrote: > On Wed, 1 Nov 2023 at 10:13, Luis Chamberlain wrote: > > > > The only thing worth highligthing is that gzip moves to use vmalloc() > > instead of > > kmalloc just as we had a fix for this for zstd on v6.6-rc1. > > Actually,

Re: [PATCH] leds: trigger: fix potential deadlock with libata

2021-03-06 Thread Andrea Righi
On Sun, Mar 07, 2021 at 10:02:32AM +0800, Boqun Feng wrote: > On Sat, Mar 06, 2021 at 09:39:54PM +0100, Marc Kleine-Budde wrote: > > Hello *, > > > > On 02.11.2020 11:41:52, Andrea Righi wrote: > > > We have the followin

[PATCH v2] x86/entry: build thunk_$(BITS) only if CONFIG_PREEMPTION=y

2021-01-23 Thread Andrea Righi
Signed-off-by: Andrea Righi --- arch/x86/entry/Makefile | 3 ++- arch/x86/entry/thunk_32.S | 2 -- arch/x86/entry/thunk_64.S | 4 arch/x86/um/Makefile | 3 ++- 4 files changed, 4 insertions(+), 8 deletions(-) ChangeLog (v1 -> v2): - do not break UML build diff --git a/arch/x86/e

Re: [tip: x86/entry] x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y

2021-01-21 Thread Andrea Righi
On Thu, Jan 21, 2021 at 09:52:01AM +0100, Andrea Righi wrote: > On Thu, Jan 21, 2021 at 08:49:28AM +0100, Ingo Molnar wrote: > > > > * tip-bot2 for Andrea Righi wrote: > > > > > The following commit has been merged into the x86/entry branch

Re: [tip: x86/entry] x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y

2021-01-21 Thread Andrea Righi
On Thu, Jan 21, 2021 at 08:49:28AM +0100, Ingo Molnar wrote: > > * tip-bot2 for Andrea Righi wrote: > > > The following commit has been merged into the x86/entry branch of tip: > > > > Commit-ID: e6d92b6680371ae1aeeb6c5eb2387fdc5d9a2c89 > > Gitweb:

[tip: x86/entry] x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y

2021-01-20 Thread tip-bot2 for Andrea Righi
The following commit has been merged into the x86/entry branch of tip: Commit-ID: e6d92b6680371ae1aeeb6c5eb2387fdc5d9a2c89 Gitweb: https://git.kernel.org/tip/e6d92b6680371ae1aeeb6c5eb2387fdc5d9a2c89 Author:Andrea Righi AuthorDate:Thu, 14 Jan 2021 12:48:35 +01:00 Committer

[PATCH] x86/entry: build thunk_$(BITS) only if CONFIG_PREEMPTION=y

2021-01-14 Thread Andrea Righi
Signed-off-by: Andrea Righi --- arch/x86/entry/Makefile | 3 ++- arch/x86/entry/thunk_32.S | 2 -- arch/x86/entry/thunk_64.S | 4 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile index 08bf95dbc911..83c98dae74a6 100644 ---

[PATCH] ring-buffer: set the right timestamp in the slow path of __rb_reserve_next()

2020-11-28 Thread Andrea Righi
the event that we are currently processing is not the last event in the buffer. Link: https://lwn.net/Articles/831207 Fixes: a389d86f7fd0 ("ring-buffer: Have nested events still record running time stamp") Signed-off-by: Andrea Righi --- kernel/trace/ring_buffer.c | 6 +++--- 1 file

Re: [PATCH] leds: trigger: fix potential deadlock with libata

2020-11-25 Thread Andrea Righi
On Wed, Nov 25, 2020 at 03:15:18PM +0100, Andrea Righi wrote: ... > > I'd hate to see this in stable 3 days after Linus merges it... > > > > Do these need _irqsave, too? > > > > drivers/leds/led-triggers.c: read_lock(>leddev_list_lock); > > dri

[PATCH v2] leds: trigger: fix potential deadlock with libata

2020-11-25 Thread Andrea Righi
lar usages. Link: https://lore.kernel.org/lkml/20201101092614.GB3989@xps-13-7390/ Fixes: eb25cb9956cc ("leds: convert IDE trigger to common disk trigger") Signed-off-by: Andrea Righi --- drivers/leds/led-triggers.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) Cha

Re: [PATCH] leds: trigger: fix potential deadlock with libata

2020-11-25 Thread Andrea Righi
- - > > led_trigger_event(): > >read_lock(>leddev_list_lock); > > > > ata_hsm_qc_complete(): > > spin_lock_irqsave(>lock)

Re: lockdep: possible irq lock inversion dependency detected (trig->leddev_list_lock)

2020-11-05 Thread Andrea Righi
On Mon, Nov 02, 2020 at 10:09:28AM +0100, Andrea Righi wrote: > On Mon, Nov 02, 2020 at 09:56:58AM +0100, Pavel Machek wrote: > > Hi! > > > > > > > I'm getting the following lockdep splat (see below). > > > > > > > > > >

[PATCH] leds: trigger: fix potential deadlock with libata

2020-11-02 Thread Andrea Righi
can happen in between, preventing the deadlock condition. Link: https://lore.kernel.org/lkml/20201101092614.GB3989@xps-13-7390/ Fixes: eb25cb9956cc ("leds: convert IDE trigger to common disk trigger") Signed-off-by: Andrea Righi --- drivers/leds/led-triggers.c | 5 +++-- 1 file changed, 3 insertions

Re: lockdep: possible irq lock inversion dependency detected (trig->leddev_list_lock)

2020-11-02 Thread Andrea Righi
On Mon, Nov 02, 2020 at 09:56:58AM +0100, Pavel Machek wrote: > Hi! > > > > > I'm getting the following lockdep splat (see below). > > > > > > > > Apparently this warning starts to be reported after applying: > > > > > > > > e918188611f0 ("locking: More accurate annotations for read_lock()") >

Re: lockdep: possible irq lock inversion dependency detected (trig->leddev_list_lock)

2020-11-01 Thread Andrea Righi
On Sun, Nov 01, 2020 at 05:28:38PM +0100, Pavel Machek wrote: > Hi! > > > I'm getting the following lockdep splat (see below). > > > > Apparently this warning starts to be reported after applying: > > > > e918188611f0 ("locking: More accurate annotations for read_lock()") > > > > It looks

Re: lockdep: possible irq lock inversion dependency detected (trig->leddev_list_lock)

2020-11-01 Thread Andrea Righi
On Sat, Oct 31, 2020 at 06:17:40PM +0800, Boqun Feng wrote: > Hi Andrea, > > On Sun, Nov 01, 2020 at 10:26:14AM +0100, Andrea Righi wrote: > > I'm getting the following lockdep splat (see below). > > > > Apparently this warning starts to be reported after apply

lockdep: possible irq lock inversion dependency detected (trig->leddev_list_lock)

2020-11-01 Thread Andrea Righi
I'm getting the following lockdep splat (see below). Apparently this warning starts to be reported after applying: e918188611f0 ("locking: More accurate annotations for read_lock()") It looks like a false positive to me, but it made me think a bit and IIUC there can be still a potential

[PATCH] ext4: properly check for dirty state in ext4_inode_datasync_dirty()

2020-10-24 Thread Andrea Righi
l.org/lkml/20201024131333.GA32124@xps-13-7390 Fixes: aa75f4d3daae ("ext4: main fast-commit commit path") Signed-off-by: Andrea Righi --- fs/ext4/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 03c2253005f0..a890a17ab7e1

Re: swap file broken with ext4 fast-commit

2020-10-24 Thread Andrea Righi
On Sat, Oct 24, 2020 at 03:13:37PM +0200, Andrea Righi wrote: > I'm getting the following error if I try to create and activate a swap > file defined on an ext4 filesystem: > > [ 34.406479] swapon: file is not committed > > The swap file is created in the root filesy

swap file broken with ext4 fast-commit

2020-10-24 Thread Andrea Righi
I'm getting the following error if I try to create and activate a swap file defined on an ext4 filesystem: [ 34.406479] swapon: file is not committed The swap file is created in the root filesystem (ext4 mounted with the following options): $ grep " / " /proc/mounts /dev/vda1 / ext4

Re: [PATCH RFC v2] Opportunistic memory reclaim

2020-10-05 Thread Andrea Righi
On Mon, Oct 05, 2020 at 03:46:12PM +0100, Chris Down wrote: > Andrea Righi writes: > > senpai is focused at estimating the ideal memory requirements without > > affecting performance. And this covers the use case about reducing > > memory footprint. > > > > In my

Re: [PATCH RFC v2] Opportunistic memory reclaim

2020-10-05 Thread Andrea Righi
On Mon, Oct 05, 2020 at 12:25:55PM +0100, Chris Down wrote: > Andrea Righi writes: > > This feature has been successfully used to improve hibernation time of > > cloud computing instances. > > > > Certain cloud providers allow to run "spot instances": low

Re: [PATCH RFC v2] Opportunistic memory reclaim

2020-10-05 Thread Andrea Righi
On Mon, Oct 05, 2020 at 10:35:16AM +0200, Michal Hocko wrote: > A similar thing has been proposed recently by Shakeel > http://lkml.kernel.org/r/20200909215752.1725525-1-shake...@google.com > Please have a look at the follow up discussion. Thanks for pointing this out, I wasn't aware of that

[PATCH RFC v2 2/2] mm: memcontrol: introduce opportunistic memory reclaim

2020-10-05 Thread Andrea Righi
is writing to memory.swap.reclaim (i.e., to set a timeout for the whole memory reclaim run). Signed-off-by: Andrea Righi --- Documentation/admin-guide/cgroup-v2.rst | 18 include/linux/memcontrol.h | 4 ++ mm/memcontrol.c | 59 ++

[PATCH RFC v2] Opportunistic memory reclaim

2020-10-05 Thread Andrea Righi
functionality (to re-load swapped out pages, since it ended being not very useful) - added the possibility to show the number of memory reclaimed in the last attempt (per-memcg) -------- Andrea Righi (2): mm: memcontrol: make shrin

[PATCH RFC v2 1/2] mm: memcontrol: make shrink_all_memory() memcg aware

2020-10-05 Thread Andrea Righi
-by: Andrea Righi --- include/linux/swap.h | 9 - mm/vmscan.c | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 661046994db4..1490b09a6e6c 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -368,7

Re: [RFC PATCH 2/2] PM: hibernate: introduce opportunistic memory reclaim

2020-09-21 Thread Andrea Righi
On Mon, Sep 21, 2020 at 05:36:30PM +0200, Rafael J. Wysocki wrote: ... > > > 3. It is not clear how much mm_reclaim/release is going to help. If > > > the preloading of the swapped-out pages uses some kind of LIFO order, > > > and can batch multiple pages, then it might help. Otherwise demand >

Re: crypto: aegis128: error: incompatible types when initializing type 'unsigned char' using type 'uint8x16_t'

2020-07-30 Thread Andrea Righi
On Thu, Jul 30, 2020 at 10:11:52AM -0500, Justin Forbes wrote: > On Mon, Jul 27, 2020 at 8:05 AM Andrea Righi > wrote: > > > > I'm experiencing this build error on arm64 after updating to gcc 10: > > > > crypto/aegis128-neon-inner.c: In function 'crypto_aegis128_i

crypto: aegis128: error: incompatible types when initializing type 'unsigned char' using type 'uint8x16_t'

2020-07-27 Thread Andrea Righi
I'm experiencing this build error on arm64 after updating to gcc 10: crypto/aegis128-neon-inner.c: In function 'crypto_aegis128_init_neon': crypto/aegis128-neon-inner.c:151:3: error: incompatible types when initializing type 'unsigned char' using type 'uint8x16_t' 151 | k ^ vld1q_u8(const0),

[PATCH v2] xen-netfront: fix potential deadlock in xennet_remove()

2020-07-24 Thread Andrea Righi
to check also for state == "Closed" in step 4 to prevent the deadlock. Also add a 5 sec timeout any time we wait for the bus state to change, to avoid getting stuck forever in wait_event(). Signed-off-by: Andrea Righi --- Changes in v2: - remove all dev_dbg() calls (as suggested by Davi

Re: [PATCH] xen-netfront: fix potential deadlock in xennet_remove()

2020-07-24 Thread Andrea Righi
On Thu, Jul 23, 2020 at 02:57:22PM -0700, David Miller wrote: > From: Andrea Righi > Date: Wed, 22 Jul 2020 08:52:11 +0200 > > > +static int xennet_remove(struct xenbus_device *dev) > > +{ > > + struct netfront_info *info = dev_get_drvdata(>dev); > >

Re: [PATCH] mm: swap: do not wait for lock_page() in unuse_pte_range()

2020-07-22 Thread Andrea Righi
On Wed, Jul 22, 2020 at 07:04:25PM +0100, Matthew Wilcox wrote: > On Wed, Jul 22, 2020 at 07:44:36PM +0200, Andrea Righi wrote: > > Waiting for lock_page() with mm->mmap_sem held in unuse_pte_range() can > > lead to stalls while running swapoff (i.e., not being able to ssh i

[PATCH] mm: swap: do not wait for lock_page() in unuse_pte_range()

2020-07-22 Thread Andrea Righi
n. Under these conditions and without this patch applied the system can be stalled even for 15min, with this patch applied the system is always responsive. Signed-off-by: Andrea Righi --- mm/swapfile.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mm/swapfi

[PATCH] xen-netfront: fix potential deadlock in xennet_remove()

2020-07-22 Thread Andrea Righi
to check also for state == "Closed" in step 4 to prevent the deadlock. Also add a 5 sec timeout any time we wait for the bus state to change, to avoid getting stuck forever in wait_event() and add a debug message to help tracking down potential similar issues. Signed-off-by: Andrea

Re: [RFC PATCH 2/2] PM: hibernate: introduce opportunistic memory reclaim

2020-06-09 Thread Andrea Righi
On Mon, Jun 08, 2020 at 03:23:22PM -0700, Luigi Semenzato wrote: > Hi Andrea, > > 1. This mechanism is quite general. It is possible that, although > hibernation may be an important use, there will be other uses for it. > I suggest leaving the hibernation example and performance analysis, > but

[RFC PATCH 1/2] mm: swap: allow partial swapoff with try_to_unuse()

2020-06-01 Thread Andrea Righi
are unused, if it is true simply ignore "pages_to_unuse" and wait until all the pages are unused. In any case the value of 0 in "pages_to_unuse" means "all pages". This is required by the PM / hibernation opportunistic memory reclaim feature. Signed-off-by: Andrea Righi --- i

[RFC PATCH 2/2] PM: hibernate: introduce opportunistic memory reclaim

2020-06-01 Thread Andrea Righi
e a better quality of service in the overall cloud infrastructure. == See also == [1] https://lwn.net/Articles/821158/ [2] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html Signed-off-by: Andrea Righi --- Documentation/ABI/testing/sysfs-power | 38 +++ include/

[RFC PATCH 0/2] PM: hibernate: opportunistic memory reclaim

2020-06-01 Thread Andrea Righi
amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html [2] https://lwn.net/Articles/821158/ -------- Andrea Righi (2): mm: swap: allow partial swapoff with try_to_unuse() PM: hibernate: introduce opportunistic memo

Re: [PATCH v3] bcache: fix deadlock in bcache_allocator

2019-10-10 Thread Andrea Righi
On Wed, Aug 07, 2019 at 09:53:46PM +0800, Coly Li wrote: > On 2019/8/7 6:38 下午, Andrea Righi wrote: > > bcache_allocator can call the following: > > > > bch_allocator_thread() > > -> bch_prio_write() > > -> bch_bucket_alloc() > > ->

[tip:perf/urgent] kprobes: Fix potential deadlock in kprobe_optimizer()

2019-08-19 Thread tip-bot for Andrea Righi
Commit-ID: f1c6ece23729257fb46562ff9224cf5f61b818da Gitweb: https://git.kernel.org/tip/f1c6ece23729257fb46562ff9224cf5f61b818da Author: Andrea Righi AuthorDate: Mon, 12 Aug 2019 20:43:02 +0200 Committer: Ingo Molnar CommitDate: Mon, 19 Aug 2019 12:22:19 +0200 kprobes: Fix potential

[PATCH] kprobes: fix potential deadlock in kprobe_optimizer()

2019-08-12 Thread Andrea Righi
iately triggers the lockdep splat. Fix by acquiring text_mutex before module_mutex in kprobe_optimizer(). Fixes: d5b844a2cf50 ("ftrace/x86: Remove possible deadlock between register_kprobe() and ftrace_run_update_code()") Signed-off-by: Andrea Righi --- kernel/kprobes.c | 8

[PATCH v3] bcache: fix deadlock in bcache_allocator

2019-08-07 Thread Andrea Righi
ake sure to wake up the garbage collector thread when bch_prio_write() is failing to allocate buckets. BugLink: https://bugs.launchpad.net/bugs/1784665 BugLink: https://bugs.launchpad.net/bugs/1796292 Signed-off-by: Andrea Righi --- Changes in v3: - prevent buckets leak in bch_prio_write()

Re: [PATCH v2] bcache: fix deadlock in bcache_allocator

2019-08-07 Thread Andrea Righi
On Tue, Aug 06, 2019 at 07:36:48PM +0200, Andrea Righi wrote: > On Tue, Aug 06, 2019 at 11:18:01AM +0200, Andrea Righi wrote: > > bcache_allocator() can call the following: > > > > bch_allocator_thread() > > -> bch_prio_write() > > -> bch_buc

Re: [PATCH v2] bcache: fix deadlock in bcache_allocator

2019-08-06 Thread Andrea Righi
On Tue, Aug 06, 2019 at 11:18:01AM +0200, Andrea Righi wrote: > bcache_allocator() can call the following: > > bch_allocator_thread() > -> bch_prio_write() > -> bch_bucket_alloc() > -> wait on >set->bucket_wait > > But the wake up event

[PATCH v2] bcache: fix deadlock in bcache_allocator

2019-08-06 Thread Andrea Righi
Moreover, make sure to wake up the garbage collector thread when bch_prio_write() is failing to allocate buckets. BugLink: https://bugs.launchpad.net/bugs/1784665 BugLink: https://bugs.launchpad.net/bugs/1796292 Signed-off-by: Andrea Righi --- Changes in v2: - prevent retry_invalidate busy loop in bch_

Re: [PATCH] bcache: fix deadlock in bcache_allocator()

2019-08-06 Thread Andrea Righi
On Wed, Jul 10, 2019 at 05:46:56PM +0200, Andrea Righi wrote: > On Wed, Jul 10, 2019 at 11:11:37PM +0800, Coly Li wrote: > > On 2019/7/10 5:31 下午, Andrea Righi wrote: > > > bcache_allocator() can call the following: > > > > > > bch_allocato

Re: [PATCH] bcache: fix deadlock in bcache_allocator()

2019-07-10 Thread Andrea Righi
On Wed, Jul 10, 2019 at 11:11:37PM +0800, Coly Li wrote: > On 2019/7/10 5:31 下午, Andrea Righi wrote: > > bcache_allocator() can call the following: > > > > bch_allocator_thread() > > -> bch_prio_write() > > -> bch_bucket_alloc() &

[PATCH] bcache: fix deadlock in bcache_allocator()

2019-07-10 Thread Andrea Righi
aits on itself. Moreover, make sure to wake up the garbage collector thread when bch_prio_write() is failing to allocate buckets. BugLink: https://bugs.launchpad.net/bugs/1784665 Signed-off-by: Andrea Righi --- drivers/md/bcache/alloc.c | 6 +- drivers/md/bcache/bcache.h | 2 +-

[PATCH v2] openvswitch: fix flow actions reallocation

2019-03-28 Thread Andrea Righi
the requested data. BugLink: https://bugs.launchpad.net/bugs/1813244 Signed-off-by: Andrea Righi --- Changes in v2: - correctly resize to current_size+req_size (thanks to Pravin) net/openvswitch/flow_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/openvswitch

Re: [PATCH -tip v3 04/10] x86/kprobes: Prohibit probing on IRQ handlers directly

2019-03-26 Thread Andrea Righi
reaks one of my tests (which I probe on do_IRQ). > > OK, it seems this patch is a bit redundant, because > I found that these interrupt handler issue has been fixed > by Andrea's commit before merge this patch. > > commit a50480cb6d61d5c5fc13308479407b628b6bc1c5 > Author: And

[PATCH v2] btrfs: raid56: properly unmap parity page in finish_parity_scrub()

2019-03-14 Thread Andrea Righi
dev/sde - mount it: # mount /dev/sdb /mnt - run btrfs scrub in a loop: # while :; do btrfs scrub start -BR /mnt; done BugLink: https://bugs.launchpad.net/bugs/1812845 Reviewed-by: Johannes Thumshirn Signed-off-by: Andrea Righi --- Changes in v2: - added a better description about this

[PATCH v4] blkcg: prevent priority inversion problem during sync()

2019-03-09 Thread Andrea Righi
/640 Signed-off-by: Andrea Righi --- Changes in v4: - fix a build bug when CONFIG_BLOCK is unset block/blk-cgroup.c | 130 +++ block/blk-throttle.c | 11 ++- fs/fs-writeback.c| 5 ++ fs/sync.c| 8

[PATCH v3] blkcg: prevent priority inversion problem during sync()

2019-03-08 Thread Andrea Righi
/640 Signed-off-by: Andrea Righi --- Changes in v3: - drop sync(2) isolation patches (this will be addressed by another patch, potentially operating at the fs namespace level) - use a per-bdi lock and a per-bdi list instead of a global lock and a global list to save the list of sync(2

Re: [PATCH v2 0/3] blkcg: sync() isolation

2019-03-08 Thread Andrea Righi
On Fri, Mar 08, 2019 at 12:22:20PM -0500, Josef Bacik wrote: > On Thu, Mar 07, 2019 at 07:08:31PM +0100, Andrea Righi wrote: > > = Problem = > > > > When sync() is executed from a high-priority cgroup, the process is forced > > to > > wait the completion of the

Re: [PATCH v2 3/3] blkcg: implement sync() isolation

2019-03-07 Thread Andrea Righi
On Thu, Mar 07, 2019 at 05:07:01PM -0500, Josef Bacik wrote: > On Thu, Mar 07, 2019 at 07:08:34PM +0100, Andrea Righi wrote: > > Keep track of the inodes that have been dirtied by each blkcg cgroup and > > make sure that a blkcg issuing a sync() can trigger the writeback + wait &g

Re: [PATCH v2 1/3] blkcg: prevent priority inversion problem during sync()

2019-03-07 Thread Andrea Righi
On Thu, Mar 07, 2019 at 05:10:53PM -0500, Josef Bacik wrote: > On Thu, Mar 07, 2019 at 07:08:32PM +0100, Andrea Righi wrote: > > Prevent priority inversion problem when a high-priority blkcg issues a > > sync() and it is forced to wait the completion of all the writeback I/O >

[PATCH v2 2/3] blkcg: introduce io.sync_isolation

2019-03-07 Thread Andrea Righi
only dirty pages that belong to the cgroup itself (except for the root cgroup that would still be able to write out all pages globally). Signed-off-by: Andrea Righi --- Documentation/admin-guide/cgroup-v2.rst | 9 ++ block/blk-throttle.c| 37

[PATCH v2 3/3] blkcg: implement sync() isolation

2019-03-07 Thread Andrea Righi
behavior is applied: sync() triggers the writeback of any dirty page. Signed-off-by: Andrea Righi --- block/blk-cgroup.c | 47 ++ fs/fs-writeback.c | 52 +++--- fs/inode.c | 1 + include/linux/blk

[PATCH v2 1/3] blkcg: prevent priority inversion problem during sync()

2019-03-07 Thread Andrea Righi
policy could be to adjust the throttling I/O rate using the blkcg with the highest speed from the list of waiters - priority inheritance, kinda). Signed-off-by: Andrea Righi --- block/blk-cgroup.c | 131 +++ block/blk-throttle.c | 11 ++- fs/fs

[PATCH v2 0/3] blkcg: sync() isolation

2019-03-07 Thread Andrea Righi
user 0m0,001s sys0m0,008s [ Time range goes from 0.7s to 1.6s ] Changes in v2: - fix: properly keep track of sync waiters when a blkcg is writing to many block devices at the same time Andrea Righi (3): blkcg: prevent priority inversion problem during sync() blkcg: introduce io.

[PATCH 0/3] blkcg: sync() isolation

2019-02-19 Thread Andrea Righi
user 0m0,001s sys0m0,008s [ Time range goes from 0.7s to 1.6s ] Andrea Righi (3): blkcg: prevent priority inversion problem during sync() blkcg: introduce io.sync_isolation blkcg: implement sync() isolation Documentation/admin-guide/cgroup-v2.rst | 9 +++ block/blk-cg

[PATCH 3/3] blkcg: implement sync() isolation

2019-02-19 Thread Andrea Righi
behavior is applied: sync() triggers the writeback of any dirty page. Signed-off-by: Andrea Righi --- block/blk-cgroup.c | 47 ++ fs/fs-writeback.c | 52 +++--- fs/inode.c | 1 + include/linux/blk

[PATCH 1/3] blkcg: prevent priority inversion problem during sync()

2019-02-19 Thread Andrea Righi
policy could be to adjust the throttling I/O rate using the blkcg with the highest speed from the list of waiters - priority inheritance, kinda). Signed-off-by: Andrea Righi --- block/blk-cgroup.c | 73 block/blk-throttle.c | 11 +++-- fs/fs

[PATCH 2/3] blkcg: introduce io.sync_isolation

2019-02-19 Thread Andrea Righi
only dirty pages that belong to the cgroup itself (except for the root cgroup that would still be able to write out all pages globally). Signed-off-by: Andrea Righi --- Documentation/admin-guide/cgroup-v2.rst | 9 ++ block/blk-throttle.c| 37

[tip:perf/core] kprobes: Prohibit probing on bsearch()

2019-02-13 Thread tip-bot for Andrea Righi
Commit-ID: 02106f883cd745523f7766d90a739f983f19e650 Gitweb: https://git.kernel.org/tip/02106f883cd745523f7766d90a739f983f19e650 Author: Andrea Righi AuthorDate: Wed, 13 Feb 2019 01:15:34 +0900 Committer: Ingo Molnar CommitDate: Wed, 13 Feb 2019 08:16:41 +0100 kprobes: Prohibit probing

Re: [RFC PATCH v2] blkcg: prevent priority inversion problem during sync()

2019-02-11 Thread Andrea Righi
On Mon, Feb 11, 2019 at 10:39:34AM -0500, Josef Bacik wrote: > On Sat, Feb 09, 2019 at 03:07:49PM +0100, Andrea Righi wrote: > > This is an attempt to mitigate the priority inversion problem of a > > high-priority blkcg issuing a sync() and being forced to wait the > &

[RFC PATCH v2] blkcg: prevent priority inversion problem during sync()

2019-02-09 Thread Andrea Righi
with any definitive solution. This patch is not a definitive solution either, but it's an attempt to continue addressing this issue and handling the priority inversion problem with sync() in a better way. Signed-off-by: Andrea Righi --- Changes in v2: - fix: use the proper current blkcg

Re: [RFC PATCH] blkcg: prevent priority inversion problem during sync()

2019-02-09 Thread Andrea Righi
On Sat, Feb 09, 2019 at 01:06:33PM +0100, Andrea Righi wrote: ... > +/** > + * blkcg_wb_waiters_on_bdi - check for writeback waiters on a block device > + * @bdi: block device to check > + * > + * Return true if any other blkcg is waiting for writeback on the target > block &

[RFC PATCH] blkcg: prevent priority inversion problem during sync()

2019-02-09 Thread Andrea Righi
with any definitive solution. This patch is not a definitive solution either, but it's an attempt to continue addressing the issue and, hopefully, handle the priority inversion problem with sync() in a better way. Signed-off-by: Andrea Righi --- block/blk-cgroup.c | 69

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-29 Thread Andrea Righi
On Mon, Jan 28, 2019 at 02:26:20PM -0500, Vivek Goyal wrote: > On Mon, Jan 28, 2019 at 06:41:29PM +0100, Andrea Righi wrote: > > Hi Vivek, > > > > sorry for the late reply. > > > > On Mon, Jan 21, 2019 at 04:47:15PM -0500, Vivek Goyal wrote: > > > On Sat

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-28 Thread Andrea Righi
Hi Vivek, sorry for the late reply. On Mon, Jan 21, 2019 at 04:47:15PM -0500, Vivek Goyal wrote: > On Sat, Jan 19, 2019 at 11:08:27AM +0100, Andrea Righi wrote: > > [..] > > Alright, let's skip the root cgroup for now. I think the point here is > > if we want to provide s

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-19 Thread Andrea Righi
On Fri, Jan 18, 2019 at 02:46:53PM -0500, Josef Bacik wrote: > On Fri, Jan 18, 2019 at 07:44:03PM +0100, Andrea Righi wrote: > > On Fri, Jan 18, 2019 at 11:35:31AM -0500, Josef Bacik wrote: > > > On Fri, Jan 18, 2019 at 11:31:24AM +0100, Andrea Righi wrote: > > > >

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-18 Thread Andrea Righi
On Fri, Jan 18, 2019 at 06:07:45PM +0100, Paolo Valente wrote: > > > > Il giorno 18 gen 2019, alle ore 17:35, Josef Bacik > > ha scritto: > > > > On Fri, Jan 18, 2019 at 11:31:24AM +0100, Andrea Righi wrote: > >> This is a redesign of my old cgroup-io-th

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-18 Thread Andrea Righi
On Fri, Jan 18, 2019 at 11:35:31AM -0500, Josef Bacik wrote: > On Fri, Jan 18, 2019 at 11:31:24AM +0100, Andrea Righi wrote: > > This is a redesign of my old cgroup-io-throttle controller: > > https://lwn.net/Articles/330531/ > > > > I'm resuming this old patch to point

Re: [RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-18 Thread Andrea Righi
On Fri, Jan 18, 2019 at 12:04:17PM +0100, Paolo Valente wrote: > > > > Il giorno 18 gen 2019, alle ore 11:31, Andrea Righi > > ha scritto: > > > > This is a redesign of my old cgroup-io-throttle controller: > > https://lwn.net/Articles/330531/ > > &g

[RFC PATCH 1/3] fsio-throttle: documentation

2019-01-18 Thread Andrea Righi
Document the filesystem I/O controller: description, usage, design, etc. Signed-off-by: Andrea Righi --- Documentation/cgroup-v1/fsio-throttle.txt | 142 ++ 1 file changed, 142 insertions(+) create mode 100644 Documentation/cgroup-v1/fsio-throttle.txt diff --git

[RFC PATCH 0/3] cgroup: fsio throttle controller

2019-01-18 Thread Andrea Righi
A: Correct, the tradeoff here is to tolerate I/O bursts during writeback to avoid priority inversion problems in the system. Andrea Righi (3): fsio-throttle: documentation fsio-throttle: controller infrastructure fsio-throttle: instrumentation Documentation/cgroup-v1/fsio-throt

[RFC PATCH 3/3] fsio-throttle: instrumentation

2019-01-18 Thread Andrea Righi
Apply the fsio controller to the opportune kernel functions to evaluate and throttle filesystem I/O. Signed-off-by: Andrea Righi --- block/blk-core.c | 10 ++ include/linux/writeback.h | 7 ++- mm/filemap.c | 20 +++- mm/page-writeback.c

[RFC PATCH 2/3] fsio-throttle: controller infrastructure

2019-01-18 Thread Andrea Righi
This is the core of the fsio-throttle controller: it defines the interface to the cgroup subsystem and implements the I/O measurement and throttling logic. Signed-off-by: Andrea Righi --- include/linux/cgroup_subsys.h | 4 + include/linux/fsio-throttle.h | 43 +++ init/Kconfig

Re: [PATCH v2 0/9] kprobes: Fix and improve blacklist symbols

2019-01-12 Thread Andrea Righi
can be called > by configuration change, I'll continue to test it. Hi Masami, I think I've found another recursion problem. Could you include also this one? Thanks, From: Andrea Righi Subject: [PATCH] kprobes: prohibit probing on bsearch() Since kprobe breakpoing handler is using bsearch

[PATCH v2] tracing/kprobes: fix NULL pointer dereference in trace_kprobe_create()

2019-01-10 Thread Andrea Righi
//lore.kernel.org/lkml/20190111095108.b79a2ee026185cbd62365...@kernel.org Fixes: 6212dd29683e ("tracing/kprobes: Use dyn_event framework for kprobe events") Cc: sta...@vger.kernel.org Signed-off-by: Andrea Righi Signed-off-by: Masami Hiramatsu --- v2: argument check refactoring kernel/trace/tra

[PATCH] tracing/kprobes: fix NULL pointer dereference in trace_kprobe_create()

2019-01-10 Thread Andrea Righi
0xf0 ? _cond_resched+0x19/0x40 vfs_write+0xb1/0x1a0 ksys_write+0x55/0xc0 __x64_sys_write+0x1a/0x20 do_syscall_64+0x5a/0x120 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fix by doing the proper argument check when a NULL symbol is passed in trace_kprobe_create(). Signed-off-by: Andrea Ri

Re: [PATCH v2 0/3] kprobes: Fix kretprobe issues

2019-01-08 Thread Andrea Righi
ith the asm-coded trampoline > code, since previously it used another kprobe for hooking > the function return placeholder (which only has a nop) and > trampoline handler was called from that kprobe. > > To fix this bug, I introduced a dummy kprobe and set it in > current_kprobe as we did in old days. > > Thank you, It looks all good to me, with this patch set I couldn't break the kernel in any way. Tested-by: Andrea Righi Thanks, -Andrea

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 04:28:33PM -0500, Steven Rostedt wrote: > On Mon, 7 Jan 2019 22:19:04 +0100 > Andrea Righi wrote: > > > > > If we put a kretprobe to raw_spin_lock_irqsave() it looks like > > > > kretprobe is going to call kretprobe... > > >

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 02:59:18PM -0500, Steven Rostedt wrote: > On Mon, 7 Jan 2019 20:52:09 +0100 > Andrea Righi wrote: > > > > Ug, kretprobe calls spinlocks in the callback? I wonder if we can > > > remove them. > > > > > > I'm guessing this is a

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 02:27:49PM -0500, Steven Rostedt wrote: > On Mon, 7 Jan 2019 19:34:44 +0100 > Andrea Righi wrote: > > > On Mon, Jan 07, 2019 at 10:31:34PM +0900, Masami Hiramatsu wrote: > > ... > > > BTW, this is not all of issues. To remove CONFIG_KPRO

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
f CONFIG_INLINE_SPIN_UNLOCK_BH @@ -200,6 +210,7 @@ void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock) __raw_spin_unlock_bh(lock); } EXPORT_SYMBOL(_raw_spin_unlock_bh); +NOKPROBE_SYMBOL(_raw_spin_unlock_bh); #endif #ifndef CONFIG_INLINE_READ_TRYLOCK Signed-off-by: Andrea Righi

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
el panic happens only when we put 2 k*ret*probes on > ftrace_ops_assist_func() and other functions. If we put kprobes, it > doesn't cause any issue, since it doesn't change the return address. > > To fix (or just avoid) this issue, we can introduce a frame pointer > verification to skip wrong order entries. And I also would like to > blacklist those functions because those are part of ftrace-based > kprobe handling routine. > > BTW, this is not all of issues. To remove CONFIG_KPROBE_EVENTS_ON_NOTRACE > I'm trying to find out other notrace functions which can cause > kernel crash by probing. Mostly done on x86, so I'll post it > after this series. > > Thank you, Apart than the missing include in PATCH 2/2 everything else looks good to me. Tested-by: Andrea Righi Thanks! -Andrea

Re: [PATCH 2/2] kprobes: Mark ftrace mcount handler functions nokprobe

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 10:32:32PM +0900, Masami Hiramatsu wrote: > Mark ftrace mcount handler functions nokprobe since > probing on these functions with kretprobe pushes > return address incorrectly on kretprobe shadow stack. > > Signed-off-by: Masami Hiramatsu > Reported-by: Francis

Re: [PATCH v2 0/3] x86: kprobes: Show correct blaclkist in debugfs

2019-01-01 Thread Andrea Righi
On Tue, Jan 01, 2019 at 10:16:54PM +0900, Masami Hiramatsu wrote: ... > > > > > Do you see a nice and clean way to blacklist all these functions > > > > > (something like arch_populate_kprobe_blacklist()), or should we just > > > > > flag all of them explicitly with NOKPROBE_SYMBOL()? > > > > > >

Re: [PATCH v2 0/3] x86: kprobes: Show correct blaclkist in debugfs

2018-12-27 Thread Andrea Righi
On Tue, Dec 18, 2018 at 06:24:35PM +0100, Andrea Righi wrote: > On Tue, Dec 18, 2018 at 01:50:26PM +0900, Masami Hiramatsu wrote: > ... > > > Side question: there are certain symbols in arch/x86/xen that should be > > > blacklisted explicitly, because they're non-attac

Re: [PATCH v2 0/3] x86: kprobes: Show correct blaclkist in debugfs

2018-12-18 Thread Andrea Righi
On Tue, Dec 18, 2018 at 01:50:26PM +0900, Masami Hiramatsu wrote: ... > > Side question: there are certain symbols in arch/x86/xen that should be > > blacklisted explicitly, because they're non-attachable. > > > > More exactly, all functions defined in arch/x86/xen/spinlock.c, > >

Re: [PATCH v2 0/3] x86: kprobes: Show correct blaclkist in debugfs

2018-12-17 Thread Andrea Righi
ch_populate_kprobe_blacklist() > so that user can get the correct kprobe blacklist in debugfs. > > Thank you, Looks good to me. Thanks! Tested-by: Andrea Righi Side question: there are certain symbols in arch/x86/xen that should be blacklisted explicitly, because they're non-attachable

[PATCH] kprobes/x86/xen: blacklist non-attachable xen interrupt functions

2018-12-10 Thread Andrea Righi
Blacklist symbols in Xen probe-prohibited areas, so that user can see these prohibited symbols in debugfs. See also: a50480cb6d61. Signed-off-by: Andrea Righi --- arch/x86/xen/xen-asm_64.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Andrea Righi
On Sat, Dec 08, 2018 at 12:48:59PM +0900, Masami Hiramatsu wrote: > On Fri, 7 Dec 2018 18:58:05 +0100 > Andrea Righi wrote: > > > On Sat, Dec 08, 2018 at 01:01:20AM +0900, Masami Hiramatsu wrote: > > > Hi Andrea and Ingo, > > > > > > Here is the pat

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Andrea Righi
On Sat, Dec 08, 2018 at 12:48:59PM +0900, Masami Hiramatsu wrote: > On Fri, 7 Dec 2018 18:58:05 +0100 > Andrea Righi wrote: > > > On Sat, Dec 08, 2018 at 01:01:20AM +0900, Masami Hiramatsu wrote: > > > Hi Andrea and Ingo, > > > > > > Here is the pat

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Andrea Righi
On Sat, Dec 08, 2018 at 12:42:10PM +0900, Masami Hiramatsu wrote: > On Fri, 7 Dec 2018 18:00:26 +0100 > Andrea Righi wrote: > > > On Sat, Dec 08, 2018 at 01:01:20AM +0900, Masami Hiramatsu wrote: > > > Hi Andrea and Ingo, > > > > > > Here is the pat

Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions

2018-12-07 Thread Andrea Righi
On Sat, Dec 08, 2018 at 12:42:10PM +0900, Masami Hiramatsu wrote: > On Fri, 7 Dec 2018 18:00:26 +0100 > Andrea Righi wrote: > > > On Sat, Dec 08, 2018 at 01:01:20AM +0900, Masami Hiramatsu wrote: > > > Hi Andrea and Ingo, > > > > > > Here is the pat

  1   2   3   >