Re: svn commit: r362126 - head/sys/vm
On 6/18/20 10:53 AM, Conrad Meyer wrote: > On Thu, Jun 18, 2020 at 10:19 AM John Baldwin wrote: >> >> On 6/17/20 5:48 PM, Conrad Meyer wrote: >>> db_printf checks the pager, via db_putc. >> >> It doesn't break out of the loops for you though (e.g. via setjmp or the >> like). Commands still have to check db_pager_quit directly if they wish >> to abort early to honor a user entering 'q' at the pager prompt. > > It does for Ctrl-C, but not 'q', true. It could easily do the same > for 'q' as Ctrl-C: db_error(NULL) => kdb_reenter_silent(). That's only safe if commands are always idempotent. Some commands can use try locks (though they really shouldn't). Having printf() auto-convert is potentially worse for this as it affects doing a 'call' of an arbitrary function (which is likely not written to be safe for DDB). Though that's already a bit fraught with dragons since any nested panic already does the longjmp. We skip locking (though only somewhat, you can "unlock" a lock held by the interrupted code in your thread by calling a function). It may be that having 'q' longjmp is ok and wouldn't really be more fragile than what is already there. That is still orthogonal to your patch (which is printf -> db_printf in effect) (and so 2 separate things to consider). -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r362126 - head/sys/vm
On Thu, Jun 18, 2020 at 10:19 AM John Baldwin wrote: > > On 6/17/20 5:48 PM, Conrad Meyer wrote: > > db_printf checks the pager, via db_putc. > > It doesn't break out of the loops for you though (e.g. via setjmp or the > like). Commands still have to check db_pager_quit directly if they wish > to abort early to honor a user entering 'q' at the pager prompt. It does for Ctrl-C, but not 'q', true. It could easily do the same for 'q' as Ctrl-C: db_error(NULL) => kdb_reenter_silent(). ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r362126 - head/sys/vm
On 6/17/20 5:48 PM, Conrad Meyer wrote: > On Wed, Jun 17, 2020 at 10:50 AM John Baldwin wrote: >> >> On 6/12/20 3:33 PM, Conrad Meyer wrote: >>> On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen wrote: Honor db_pager_quit in some vm_object ddb commands These can be rather verbose. >>> >>> We also have this (?)hack in OneFS, which eliminates the need for >>> every debug function to check the db_pager globals: >>> >>> https://people.freebsd.org/~cem/db_pager.patch >>> >>> I'm not sure how objectionable it is. >> >> I don't think this addresses that. I think this patch makes printf turn >> into db_printf when a function is invoked from DDB which is orthogonal. >> db_printf() itself doesn't check the pager. > > db_printf checks the pager, via db_putc. It doesn't break out of the loops for you though (e.g. via setjmp or the like). Commands still have to check db_pager_quit directly if they wish to abort early to honor a user entering 'q' at the pager prompt. -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r362126 - head/sys/vm
On Wed, Jun 17, 2020 at 10:50 AM John Baldwin wrote: > > On 6/12/20 3:33 PM, Conrad Meyer wrote: > > On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen wrote: > >> Honor db_pager_quit in some vm_object ddb commands > >> > >> These can be rather verbose. > > > > We also have this (?)hack in OneFS, which eliminates the need for > > every debug function to check the db_pager globals: > > > > https://people.freebsd.org/~cem/db_pager.patch > > > > I'm not sure how objectionable it is. > > I don't think this addresses that. I think this patch makes printf turn > into db_printf when a function is invoked from DDB which is orthogonal. > db_printf() itself doesn't check the pager. db_printf checks the pager, via db_putc. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r362126 - head/sys/vm
On 6/12/20 3:33 PM, Conrad Meyer wrote: > On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen wrote: >> Honor db_pager_quit in some vm_object ddb commands >> >> These can be rather verbose. > > We also have this (?)hack in OneFS, which eliminates the need for > every debug function to check the db_pager globals: > > https://people.freebsd.org/~cem/db_pager.patch > > I'm not sure how objectionable it is. I don't think this addresses that. I think this patch makes printf turn into db_printf when a function is invoked from DDB which is orthogonal. db_printf() itself doesn't check the pager. -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r362126 - head/sys/vm
On Fri, Jun 12, 2020 at 2:53 PM Eric van Gyzen wrote: > Honor db_pager_quit in some vm_object ddb commands > > These can be rather verbose. We also have this (?)hack in OneFS, which eliminates the need for every debug function to check the db_pager globals: https://people.freebsd.org/~cem/db_pager.patch I'm not sure how objectionable it is. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r362126 - head/sys/vm
Author: vangyzen Date: Fri Jun 12 21:53:08 2020 New Revision: 362126 URL: https://svnweb.freebsd.org/changeset/base/362126 Log: Honor db_pager_quit in some vm_object ddb commands These can be rather verbose. MFC after:2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c == --- head/sys/vm/vm_object.c Fri Jun 12 21:51:20 2020(r362125) +++ head/sys/vm/vm_object.c Fri Jun 12 21:53:08 2020(r362126) @@ -2694,6 +2694,8 @@ DB_SHOW_COMMAND(vmochk, vm_object_check) (void *)object->backing_object); } } + if (db_pager_quit) + return; } } @@ -2744,6 +2746,9 @@ DB_SHOW_COMMAND(object, vm_object_print_static) db_printf("(off=0x%jx,page=0x%jx)", (uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p)); + + if (db_pager_quit) + break; } if (count != 0) db_printf("\n"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"