Re: [PATCH v2] block: fix iolat timestamp and restore accounting semantics

2018-12-13 Thread Josef Bacik
On Thu, Dec 13, 2018 at 12:59:03PM -0700, Jens Axboe wrote: > On 12/13/18 12:52 PM, Josef Bacik wrote: > > On Thu, Dec 13, 2018 at 12:48:11PM -0700, Jens Axboe wrote: > >> On 12/11/18 4:01 PM, Dennis Zhou wrote: > >>> The blk-iolatency controller measures the time f

Re: [PATCH v2] block: fix iolat timestamp and restore accounting semantics

2018-12-13 Thread Josef Bacik
On Thu, Dec 13, 2018 at 12:48:11PM -0700, Jens Axboe wrote: > On 12/11/18 4:01 PM, Dennis Zhou wrote: > > The blk-iolatency controller measures the time from rq_qos_throttle() to > > rq_qos_done_bio() and attributes this time to the first bio that needs > > to create the request. This means if a bi

[PATCH][v6] filemap: drop the mmap_sem for all blocking operations

2018-12-12 Thread Josef Bacik
a page lock and still have a not uptodate page. This allows us to deal with this case by grabbing the lock and issuing the IO without the mmap_sem held, and then returning VM_FAULT_RETRY to come back around. Acked-by: Johannes Weiner Signed-off-by: Josef Bacik --- v5->v6: - added more comm

[PATCH 2/3] filemap: pass vm_fault to the mmap ra helpers

2018-12-11 Thread Josef Bacik
All of the arguments to these functions come from the vmf, and the following patches are going to add more arguments. Cut down on the amount of arguments passed by simply passing in the vmf to these two helpers. Signed-off-by: Josef Bacik --- mm/filemap.c | 28 ++-- 1

[PATCH 0/3][V5] drop the mmap_sem when doing IO in the fault path

2018-12-11 Thread Josef Bacik
Here's the latest version, slimmed down a bit from my last submission with more details in the changelogs as requested. v4->v5: - dropped the cached_page infrastructure and the addition of the handle_mm_fault_cacheable helper as it had no discernable bearing on performance in my performance te

[PATCH 3/3] filemap: drop the mmap_sem for all blocking operations

2018-12-11 Thread Josef Bacik
a page lock and still have a not uptodate page. This allows us to deal with this case by grabbing the lock and issuing the IO without the mmap_sem held, and then returning VM_FAULT_RETRY to come back around. Acked-by: Johannes Weiner Signed-off-by: Josef Ba

[PATCH 1/3] filemap: kill page_cache_read usage in filemap_fault

2018-12-11 Thread Josef Bacik
ag so that pagecache_get_page() will return a unlocked page that's in pagecache. Then use the normal page locking and readpage logic already in filemap_fault. This simplifies the no page in page cache case significantly. Acked-by: Johannes Weiner Reviewed-by: Jan Kara Signed-off-

Re: [PATCH 3/4] filemap: drop the mmap_sem for all blocking operations

2018-12-11 Thread Josef Bacik
On Tue, Dec 11, 2018 at 10:40:34AM +0100, Jan Kara wrote: > On Mon 10-12-18 13:44:39, Josef Bacik wrote: > > On Fri, Dec 07, 2018 at 12:01:38PM +0100, Jan Kara wrote: > > > On Fri 30-11-18 14:58:11, Josef Bacik wrote: > > > > @@ -2433,9 +2458,32 @@ vm_fault_t file

Re: [PATCH 3/4] filemap: drop the mmap_sem for all blocking operations

2018-12-10 Thread Josef Bacik
On Fri, Dec 07, 2018 at 12:01:38PM +0100, Jan Kara wrote: > On Fri 30-11-18 14:58:11, Josef Bacik wrote: > > Currently we only drop the mmap_sem if there is contention on the page > > lock. The idea is that we issue readahead and then go to lock the page > > while it is un

Re: [PATCH] block: fix iolat timestamp and restore accounting semantics

2018-12-10 Thread Josef Bacik
ors by accounting time separately in a bio > adding the field bi_start. If this field is set, the bio should be > processed by blk-iolatency in rq_qos_done_bio(). > > [1] https://lore.kernel.org/lkml/20181205171039.73066-1-den...@kernel.org/ > > Signed-off-by: Dennis Zhou

Re: [PATCH 4/4] mm: use the cached page for filemap_fault

2018-12-05 Thread Josef Bacik
On Tue, Dec 04, 2018 at 02:50:34PM -0800, Andrew Morton wrote: > On Fri, 30 Nov 2018 14:58:12 -0500 Josef Bacik wrote: > > > If we drop the mmap_sem we have to redo the vma lookup which requires > > redoing the fault handler. Chances are we will just come back to the > >

[PATCH 4/4] mm: use the cached page for filemap_fault

2018-11-30 Thread Josef Bacik
If we drop the mmap_sem we have to redo the vma lookup which requires redoing the fault handler. Chances are we will just come back to the same page, so save this page in our vmf->cached_page and reuse it in the next loop through the fault handler. Signed-off-by: Josef Bacik --- mm/filema

[PATCH 3/4] filemap: drop the mmap_sem for all blocking operations

2018-11-30 Thread Josef Bacik
sem. Signed-off-by: Josef Bacik --- mm/filemap.c | 113 --- 1 file changed, 93 insertions(+), 20 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index f068712c2525..5e76b24b2a0f 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2304

[PATCH 1/4] mm: infrastructure for page fault page caching

2018-11-30 Thread Josef Bacik
've converted x86, other arch's can follow suit if they so wish, it's relatively straightforward. Signed-off-by: Josef Bacik --- arch/x86/mm/fault.c | 6 +++- include/linux/mm.h | 31 + mm/memory.c | 79

[PATCH 2/4] filemap: kill page_cache_read usage in filemap_fault

2018-11-30 Thread Josef Bacik
ag so that pagecache_get_page() will return a unlocked page that's in pagecache. Then use the normal page locking and readpage logic already in filemap_fault. This simplifies the no page in page cache case significantly. Signed-off-by: Josef Bacik --- include/linux/pagemap.h | 1

[PATCH 0/4][V4] drop the mmap_sem when doing IO in the fault path

2018-11-30 Thread Josef Bacik
v3->v4: - dropped the ->page_mkwrite portion of these patches, we don't actually see issues with mkwrite in production, and I kept running into corner cases where I missed something important. I want to wait on that part until I have a real reason to do the work so I can have a solid test in

Re: [PATCH] mm: Fix int overflow in callers of do_shrink_slab()

2018-09-28 Thread Josef Bacik
bjects returned by do_shrink_slab() > may be interpreted as SHRINK_EMPTY, if low bytes of > their value are equal to 0xfffe. Fix that > by declaration ret as unsigned long in these functions. > > Reported-by: Cyrill Gorcunov > Signed-off-by: Kirill Tkhai Reviewed-by: Josef Bacik Thanks, Josef

[RFC][PATCH 0/8] drop the mmap_sem when doing IO in the fault path

2018-09-25 Thread Josef Bacik
Now that we have proper isolation in place with cgroups2 we have started going through and fixing the various priority inversions. Most are all gone now, but this one is sort of weird since it's not necessarily a priority inversion that happens within the kernel, but rather because of something us

Re: [PATCH 08/15] blkcg: associate a blkg for pages being evicted by swap

2018-08-31 Thread Josef Bacik
swap and writeback. Here we modify the way > swap tags bios to include the blkg. Writeback will be tackle in the next > patch. > > Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Thanks, Josef

[PATCH 00/14][V4] Introduce io.latency io controller for cgroups

2018-06-27 Thread Josef Bacik
No functional changes, just fixing some panic's in configurations we weren't testing in production. v3->v4: - deal with a child having a configuration but the parent not. - fix use of setup_timer, there was an API change between the kernel I wrote/tested these patches on and the current kernel.

[PATCH 02/15] block: introduce bio_issue_as_root_blkg

2018-06-25 Thread Josef Bacik
From: Josef Bacik Instead of forcing all file systems to get the right context on their bio's, simply check for REQ_META to see if we need to issue as the root blkg. We don't want to force all bio's to have the root blkg associated with them if REQ_META is set, as some c

[PATCH 10/13] block: remove external dependency on wbt_flags

2018-06-05 Thread Josef Bacik
From: Josef Bacik We don't really need to save this stuff in the core block code, we can just pass the bio back into the helpers later on to derive the same flags and update the rq->wbt_flags appropriately. Signed-off-by: Josef Bacik --- block/blk-core.c | 9 - block/

Re: [PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Josef Bacik
On Fri, May 18, 2018 at 01:49:12PM -0400, Kent Overstreet wrote: > On Fri, May 18, 2018 at 01:45:36PM -0400, Josef Bacik wrote: > > On Fri, May 18, 2018 at 03:48:58AM -0400, Kent Overstreet wrote: > > > These are all the remaining patches in my bcachefs tree that touch st

Re: [PATCH 00/10] RFC: assorted bcachefs patches

2018-05-18 Thread Josef Bacik
On Fri, May 18, 2018 at 03:48:58AM -0400, Kent Overstreet wrote: > These are all the remaining patches in my bcachefs tree that touch stuff > outside > fs/bcachefs. Not all of them are suitable for inclusion as is, I wanted to get > some discussion first. > > * pagecache add lock > > This is th

Re: [PATCH] xfs: always free inline data before resetting inode fork during ifree

2018-03-29 Thread Josef Bacik
On Thu, Mar 29, 2018 at 06:12:23PM +, Luis R. Rodriguez wrote: > On Thu, Mar 29, 2018 at 10:05:35AM +1100, Dave Chinner wrote: > > On Wed, Mar 28, 2018 at 07:30:06PM +, Sasha Levin wrote: > > > > > > This is actually something I want maintainers to dictate. What sort of > > > testing would

Re: [PATCH v9 13/61] xarray: Add documentation

2018-03-16 Thread Josef Bacik
are talking about here Acked-by: Josef Bacik Thanks, Josef

Re: [PATCH v9 12/61] xarray: Define struct xa_node

2018-03-16 Thread Josef Bacik
without change. > > Signed-off-by: Matthew Wilcox Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH v9 11/61] xarray: Add definition of struct xarray

2018-03-16 Thread Josef Bacik
without change. > > Signed-off-by: Matthew Wilcox Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH v9 10/61] xarray: Change definition of sibling entries

2018-03-16 Thread Josef Bacik
on. > > Signed-off-by: Matthew Wilcox > --- > include/linux/xarray.h | 93 > ++ > lib/radix-tree.c | 66 +++ > 2 files changed, 112 insertions(+), 47 deletions(-) > Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH v9 09/61] xarray: Replace exceptional entries

2018-03-16 Thread Josef Bacik
_LONG - 1)); > assert(ida_pre_get(&ida, GFP_KERNEL)); > err = ida_get_new(&ida, &id); > } else { > - assert((i % IDA_BITMAP_BITS) != (BITS_PER_LONG - 2)); > + assert((i % IDA_BITMAP_BITS) != (BITS_PER_LONG - 1)); Can we just use BITS_PER_XA_VALUE here? Overall looks fine to me, I'm not married to changing any of the nits. Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH v9 08/61] page cache: Use xa_lock

2018-03-16 Thread Josef Bacik
that it's a tree. > > Signed-off-by: Matthew Wilcox > Acked-by: Jeff Layton Man my eyes started to glaze over about halfway through this one Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH] uprobe: add support for overlayfs

2018-03-05 Thread Josef Bacik
essfully register. > > Running the example above with the patch applied, we can see that the > uprobe is enabled and will output to trace as expected. > > Signed-off-by: Howard McLauchlan Reviewed-by: Josef Bacik Thanks, Josef

Re: nbd: on-the-fly resize does not work any more

2018-02-19 Thread Josef Bacik
Yeah I fucked that up, I’ll fix it when I’m back from holiday tomorrow. Thanks, Josef Sent from my iPhone > On Feb 18, 2018, at 1:08 PM, Mykola Golub wrote: > > Hi, > > It looks like after the recent changes to nbd driver, on-the-fly > resize has stopped working for rbd-nbd. Particularly thi

Re: ANNOUNCE: bpfd - a remote proxy daemon for executing bpf code (with corres. bcc changes)

2018-01-25 Thread Josef Bacik
On Wed, Jan 24, 2018 at 08:29:39PM -0800, Joel Fernandes wrote: > Hi Guys, > > Just providing an update: I made lots of progress last few weeks and > all the issues mentioned below (in the last post) are resolved. > I published an LWN article explaining the design of BPFd and BCC-side > changes: h

Re: [PATCH bpf-next v4 3/5] error-injection: Separate error-injection from kprobe

2018-01-11 Thread Josef Bacik
ION_ERROR_INJECTION is the config item of this > feature. It is automatically enabled if the arch supports > error injection feature for kprobe or ftrace etc. > > Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH bpf-next v3 5/5] error-injection: Support fault injection framework

2018-01-10 Thread Josef Bacik
2 > > mount: mount /dev/loop2 on /opt/tmpmnt failed: Cannot allocate memory > SUCCESS! > === > > > Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH bpf-next v3 4/5] error-injection: Add injectable error types

2018-01-10 Thread Josef Bacik
ern struct error_injection_entry __start_error_injection_whitelist[]; > +extern struct error_injection_entry __stop_error_injection_whitelist[]; > > static void __init populate_kernel_ei_list(void) > { > @@ -157,11 +171,26 @@ static void *ei_seq_next(struct seq_file *m, void *v, >

Re: [PATCH bpf-next v3 3/5] error-injection: Separate error-injection from kprobe

2018-01-10 Thread Josef Bacik
On Wed, Jan 10, 2018 at 07:18:05PM +0900, Masami Hiramatsu wrote: > Since error-injection framework is not limited to be used > by kprobes, nor bpf. Other kernel subsystems can use it > freely for checking safeness of error-injection, e.g. > livepatch, ftrace etc. > So this separate error-injection

Re: [PATCH bpf-next v3 2/5] tracing/kprobe: bpf: Compare instruction pointer with original one

2018-01-10 Thread Josef Bacik
an be done > in one place. > > Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik Thanks, Josef

Re: [PATCH bpf-next v3 1/5] tracing/kprobe: bpf: Check error injectable event is on function entry

2018-01-10 Thread Josef Bacik
sw-breakpoint based kprobe > events too. > > Signed-off-by: Masami Hiramatsu Reviewed-by: Josef Bacik Thanks, Josef

Re: [RFC PATCH bpf-next v2 0/4] Separate error injection table from kprobes

2018-01-04 Thread Josef Bacik
On Tue, Dec 26, 2017 at 04:46:28PM +0900, Masami Hiramatsu wrote: > Hi Josef and Alexei, > > Here are the 2nd version of patches to moving error injection > table from kprobes. In this series I did a small fixes and > add function-based fault injection. > > Here is the previous version: > > http

[PATCH] trace: reenable preemption if we modify the ip

2017-12-15 Thread Josef Bacik
From: Josef Bacik Things got moved around between the original bpf_override_return patches and the final version, and now the ftrace kprobe dispatcher assumes if you modified the ip that you also enabled preemption. Make a comment of this and enable preemption, this fixes the lockdep splat that

[PATCH v10 1/5] add infrastructure for tagging functions as error injectable

2017-12-15 Thread Josef Bacik
From: Josef Bacik Using BPF we can override kprob'ed functions and return arbitrary values. Obviously this can be a bit unsafe, so make this feature opt-in for functions. Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in order to give BPF access to that function for error inje

[PATCH v10 5/5] btrfs: allow us to inject errors at io_ctl_init

2017-12-15 Thread Josef Bacik
From: Josef Bacik This was instrumental in reproducing a space cache bug. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 4426d1c73e50

[PATCH v10 4/5] samples/bpf: add a test for bpf_override_return

2017-12-15 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Acked-by: Alexei Starovoitov Acked-by: Ingo Molnar Signed-o

[PATCH v10 3/5] bpf: add a bpf_override_function helper

2017-12-15 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH v10 0/5] Add the ability to do BPF directed error injection

2017-12-15 Thread Josef Bacik
Just one last go around I hope, fixed the preemption thing that Darrick reported. v9->v10: - the kprobe dispather now requires us to re-enable preemption if we change the ip ourselves, so do that. v8->v9: - rebased onto the bpf tree. v7->v8: - removed the _ASM_KPROBE_ERROR_INJECT since it was

[PATCH v10 2/5] btrfs: make open_ctree error injectable

2017-12-15 Thread Josef Bacik
From: Josef Bacik This allows us to do error injection with BPF for open_ctree. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/disk-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 10a2a579cc7f..02b5f5667754 100644 --- a

Re: [PATCH v9 0/5] Add the ability to do BPF directed error injection

2017-12-13 Thread Josef Bacik
On Wed, Dec 13, 2017 at 10:07:32AM -0800, Darrick J. Wong wrote: > On Wed, Dec 13, 2017 at 01:03:57PM -0500, Josef Bacik wrote: > > On Tue, Dec 12, 2017 at 03:11:50PM -0800, Darrick J. Wong wrote: > > > On Mon, Dec 11, 2017 at 11:36:45AM -0500, Josef Bacik wrote: > > &g

Re: [PATCH v9 0/5] Add the ability to do BPF directed error injection

2017-12-13 Thread Josef Bacik
On Tue, Dec 12, 2017 at 03:11:50PM -0800, Darrick J. Wong wrote: > On Mon, Dec 11, 2017 at 11:36:45AM -0500, Josef Bacik wrote: > > This is the same as v8, just rebased onto the bpf tree. > > > > v8->v9: > > - rebased onto the bpf tree. > > > > v7->v

[PATCH v9 1/5] add infrastructure for tagging functions as error injectable

2017-12-11 Thread Josef Bacik
From: Josef Bacik Using BPF we can override kprob'ed functions and return arbitrary values. Obviously this can be a bit unsafe, so make this feature opt-in for functions. Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in order to give BPF access to that function for error inje

[PATCH v9 5/5] btrfs: allow us to inject errors at io_ctl_init

2017-12-11 Thread Josef Bacik
From: Josef Bacik This was instrumental in reproducing a space cache bug. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 4426d1c73e50

[PATCH v9 4/5] samples/bpf: add a test for bpf_override_return

2017-12-11 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Acked-by: Alexei Starovoitov Acked-by: Ingo Molnar Signed-o

[PATCH v9 2/5] btrfs: make open_ctree error injectable

2017-12-11 Thread Josef Bacik
From: Josef Bacik This allows us to do error injection with BPF for open_ctree. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/disk-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 10a2a579cc7f..02b5f5667754 100644 --- a

[PATCH v9 3/5] bpf: add a bpf_override_function helper

2017-12-11 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH v9 0/5] Add the ability to do BPF directed error injection

2017-12-11 Thread Josef Bacik
This is the same as v8, just rebased onto the bpf tree. v8->v9: - rebased onto the bpf tree. v7->v8: - removed the _ASM_KPROBE_ERROR_INJECT since it was not needed. v6->v7: - moved the opt-in macro to bpf.h out of kprobes.h. v5->v6: - add BPF_ALLOW_ERROR_INJECTION() tagging for functions that w

Re: [PATCH v8 0/5] Add the ability to do BPF directed error injection

2017-12-08 Thread Josef Bacik
On Fri, Dec 08, 2017 at 04:35:44PM +0100, Daniel Borkmann wrote: > On 12/06/2017 05:12 PM, Josef Bacik wrote: > > Jon noticed that I had a typo in my _ASM_KPROBE_ERROR_INJECT macro. I went > > to > > figure out why the compiler didn't catch it and it's because i

[PATCH v8 0/5] Add the ability to do BPF directed error injection

2017-12-06 Thread Josef Bacik
Jon noticed that I had a typo in my _ASM_KPROBE_ERROR_INJECT macro. I went to figure out why the compiler didn't catch it and it's because it was not used anywhere. I had copied it from the trace blacklist code without understanding where it was used as cscope didn't find the original macro I was

[PATCH v8 4/5] samples/bpf: add a test for bpf_override_return

2017-12-06 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Acked-by: Alexei Starovoitov Acked-by: Ingo Molnar Signed-o

[PATCH v8 3/5] bpf: add a bpf_override_function helper

2017-12-06 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH v8 1/5] add infrastructure for tagging functions as error injectable

2017-12-06 Thread Josef Bacik
From: Josef Bacik Using BPF we can override kprob'ed functions and return arbitrary values. Obviously this can be a bit unsafe, so make this feature opt-in for functions. Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in order to give BPF access to that function for error inje

[PATCH v8 2/5] btrfs: make open_ctree error injectable

2017-12-06 Thread Josef Bacik
From: Josef Bacik This allows us to do error injection with BPF for open_ctree. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/disk-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index dfdab849037b..69d17a640b94 100644 --- a

[PATCH v8 5/5] btrfs: allow us to inject errors at io_ctl_init

2017-12-06 Thread Josef Bacik
From: Josef Bacik This was instrumental in reproducing a space cache bug. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index cdc9f4015ec3

Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable

2017-11-30 Thread Josef Bacik
On Wed, Nov 29, 2017 at 05:59:39PM +0100, Daniel Borkmann wrote: > On 11/28/2017 09:02 PM, Josef Bacik wrote: > > On Tue, Nov 28, 2017 at 11:58:41AM -0700, Jonathan Corbet wrote: > >> On Wed, 22 Nov 2017 16:23:30 -0500 > >> Josef Bacik wrote: > >>> From: Jo

Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable

2017-11-28 Thread Josef Bacik
On Tue, Nov 28, 2017 at 11:58:41AM -0700, Jonathan Corbet wrote: > On Wed, 22 Nov 2017 16:23:30 -0500 > Josef Bacik wrote: > > > From: Josef Bacik > > > > Using BPF we can override kprob'ed functions and return arbitrary > > values. Obviously this can be

Re: [PATCH RFC 1/2] sched: Minimize the idle cpu selection race window.

2017-11-23 Thread Josef Bacik
On Thu, Nov 23, 2017 at 02:13:01PM +0100, Mike Galbraith wrote: > On Thu, 2017-11-23 at 11:52 +0100, Uladzislau Rezki wrote: > > Hello, Atish, Peter, all. > > > > I have a question about if a task's nr_cpus_allowed is 1. > > In that scenario we do not call select_task_rq. Therefore > > even though

[PATCH v7 0/4] Add the ability to do BPF directed error injection

2017-11-22 Thread Josef Bacik
This is hopefully the final version, I've addressed the comment by Igno and added his Acks. v6->v7: - moved the opt-in macro to bpf.h out of kprobes.h. v5->v6: - add BPF_ALLOW_ERROR_INJECTION() tagging for functions that will support this feature. This way only functions that opt-in will be al

[PATCH v7 5/5] btrfs: allow us to inject errors at io_ctl_init

2017-11-22 Thread Josef Bacik
From: Josef Bacik This was instrumental in reproducing a space cache bug. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/free-space-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index cdc9f4015ec3

[PATCH v7 4/5] samples/bpf: add a test for bpf_override_return

2017-11-22 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Acked-by: Alexei Starovoitov Acked-by: Ingo Molnar Signed-o

[PATCH v7 2/5] btrfs: make open_ctree error injectable

2017-11-22 Thread Josef Bacik
From: Josef Bacik This allows us to do error injection with BPF for open_ctree. Signed-off-by: Josef Bacik Acked-by: Ingo Molnar --- fs/btrfs/disk-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index dfdab849037b..69d17a640b94 100644 --- a

[PATCH v7 1/5] add infrastructure for tagging functions as error injectable

2017-11-22 Thread Josef Bacik
From: Josef Bacik Using BPF we can override kprob'ed functions and return arbitrary values. Obviously this can be a bit unsafe, so make this feature opt-in for functions. Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in order to give BPF access to that function for error inje

[PATCH v7 3/5] bpf: add a bpf_override_function helper

2017-11-22 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH 1/4] add infrastructure for tagging functions as error injectable

2017-11-17 Thread Josef Bacik
From: Josef Bacik Using BPF we can override kprob'ed functions and return arbitrary values. Obviously this can be a bit unsafe, so make this feature opt-in for functions. Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in order to give BPF access to that function for error inje

[PATCH 3/4] bpf: add a bpf_override_function helper

2017-11-17 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH 4/4] samples/bpf: add a test for bpf_override_return

2017-11-17 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Acked-by: Alexei Starovoitov Signed-off-by: Josef

[PATCH 2/4] btrfs: make open_ctree error injectable

2017-11-17 Thread Josef Bacik
From: Josef Bacik This allows us to do error injection with BPF for open_ctree. Signed-off-by: Josef Bacik --- fs/btrfs/disk-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index dfdab849037b..c6b4e1f07072 100644 --- a/fs/btrfs/disk-io.c

[PATCH 0/4][v6] Add the ability to do BPF directed error injection

2017-11-17 Thread Josef Bacik
I've reworked this to be opt-in only as per Igno and Alexei. Still needs to go through Dave because of the bpf bits, but I need tracing guys to weigh in and sign off on my approach please. v5->v6: - add BPF_ALLOW_ERROR_INJECTION() tagging for functions that will support this feature. This way

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-13 Thread Josef Bacik
On Sun, Nov 12, 2017 at 11:38:24AM +0100, Ingo Molnar wrote: > > * Alexei Starovoitov wrote: > > > > One of the major advantages of having an in-kernel BPF sandbox is to > > > never > > > crash the kernel - and allowing BPF programs to just randomly modify the > > > return value of kernel fun

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-11 Thread Josef Bacik
On Sat, Nov 11, 2017 at 09:14:55AM +0100, Ingo Molnar wrote: > > * Josef Bacik wrote: > > > On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > > > > > * Josef Bacik wrote: > > > > > > > @@ -551,6 +578,10 @@ static const

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-10 Thread Josef Bacik
On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > * Josef Bacik wrote: > > > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > > *kprobe_prog_func_proto(enum bpf_func_id func > > return &bpf_get_stackid_proto; > >

[PATCH 2/2] samples/bpf: add a test for bpf_override_return

2017-11-07 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Acked-by: Alexei Starovoitov Signed-off-by: Josef

[PATCH 0/2][v5] Add the ability to do BPF directed error injection

2017-11-07 Thread Josef Bacik
I'm sending this through Dave since it'll conflict with other BPF changes in his tree, but since it touches tracing as well Dave would like a review from somebody on the tracing side. v4->v5: - disallow kprobe_override programs from being put in the prog map array so we don't tail call into some

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-07 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Josef Bacik
On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: > Hi Josef, > > one more issue I just noticed, see comment below: > > On 11/02/2017 03:37 PM, Josef Bacik wrote: > [...] > > diff --git a/include/linux/filter.h b/include/linux/filter.h > > index cdd

[PATCH 0/2][v4] Add the ability to do BPF directed error injection

2017-11-02 Thread Josef Bacik
I'm sending this through Dave since it'll conflict with other BPF changes in his tree, but since it touches tracing as well Dave would like a review from somebody on the tracing side. v3->v4: - fix a build error found by kbuild test bot (I didn't wait long enough apparently.) - Added a warning m

[PATCH 2/2] samples/bpf: add a test for bpf_override_return

2017-11-02 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Acked-by: Alexei Starovoitov Signed-off-by: Josef

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-02 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH 2/2] samples/bpf: add a test for bpf_override_return

2017-11-01 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Signed-off-by: Josef Bacik --- samples/bpf/Mak

[PATCH 0/2][v3] Add the ability to do BPF directed error injection

2017-11-01 Thread Josef Bacik
I'm sending this through Dave since it'll conflict with other BPF changes in his tree, but since it touches tracing as well Dave would like a review from somebody on the tracing side. v2->v3: - added a ->kprobe_override flag to bpf_prog. - added some sanity checks to disallow attaching bpf progs t

[PATCH 0/2][v2] Add the ability to do BPF directed error injection

2017-10-31 Thread Josef Bacik
v1->v2: - moved things around to make sure that bpf_override_return could really only be used for an ftrace kprobe. - killed the special return values from trace_call_bpf. - renamed pc_modified to bpf_kprobe_state so bpf_override_return could tell if it was being called from an ftrace kprobe co

[PATCH 2/2] samples/bpf: add a test for bpf_override_return

2017-10-31 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Signed-off-by: Josef Bacik --- samples/bpf/Mak

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-31 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH 2/2] samples/bpf: add a test for bpf_override_return

2017-10-30 Thread Josef Bacik
From: Josef Bacik This adds a basic test for bpf_override_return to verify it works. We override the main function for mounting a btrfs fs so it'll return -ENOMEM and then make sure that trying to mount a btrfs fs will fail. Signed-off-by: Josef Bacik --- samples/bpf/Mak

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-30 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this wit

[PATCH 0/2] Add the ability to do BPF directed error injection

2017-10-30 Thread Josef Bacik
A lot of our error paths are not well tested because we have no good way of injecting errors generically. Some subystems (block, memory) have ways to inject errors, but they are random so it's hard to get reproduceable results. With BPF we can add determinism to our error injection. We can use k

Re: [PATCH 2/2] dm log writes: add support for DAX

2017-10-23 Thread Josef Bacik
On Thu, Oct 19, 2017 at 11:24:04PM -0600, Ross Zwisler wrote: > Now that we have the ability log filesystem writes using a flat buffer, add > support for DAX. Unfortunately we can't easily track data that has been > written via mmap() now that the dax_flush() abstraction was removed by this > comm

Re: [ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-09 Thread Josef Bacik
On Tue, Oct 10, 2017 at 08:09:20AM +1100, Dave Chinner wrote: > On Mon, Oct 09, 2017 at 09:00:51AM -0400, Josef Bacik wrote: > > On Mon, Oct 09, 2017 at 04:17:31PM +1100, Dave Chinner wrote: > > > On Sun, Oct 08, 2017 at 10:25:10PM -0400, Josef Bacik wrote: > > > > &g

Re: [ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-09 Thread Josef Bacik
On Mon, Oct 09, 2017 at 04:17:31PM +1100, Dave Chinner wrote: > On Sun, Oct 08, 2017 at 10:25:10PM -0400, Josef Bacik wrote: > > On Mon, Oct 09, 2017 at 11:51:37AM +1100, Dave Chinner wrote: > > > On Fri, Oct 06, 2017 at 05:09:57PM -0400, Josef Bacik wrote: > > > &g

Re: [ANNOUNCE] fsperf: a simple fs/block performance testing framework

2017-10-09 Thread Josef Bacik
On Sun, Oct 08, 2017 at 11:43:35PM -0400, Theodore Ts'o wrote: > On Sun, Oct 08, 2017 at 10:25:10PM -0400, Josef Bacik wrote: > > > > Probably should have led with that shouldn't I have? There's nothing > > keeping me > > from doing it, but I didn&#x

<    1   2   3   4   5   6   >