Stefan Hajnoczi
2017-May-22 11:23 UTC
[PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions
On Mon, May 22, 2017 at 12:50:39PM +0200, SF Markus Elfring wrote:> > Why are you trying to get rid of memory allocation failure messages? > > Do you find information from a Linux allocation failure report sufficient > for any function implementations here?If kmalloc() and friends guarantee to print a warning and backtrace on every allocation failure, then there's no need for error messages in callers. That seems like good justification that can go in the commit description, but I'm not sure if kmalloc() and friends guarantee to show a message (not just the first time, but for every failed allocation)?> >> +++ b/drivers/vhost/scsi.c > >> @@ -417,5 +417,4 @@ vhost_scsi_allocate_evt(struct vhost_scsi *vs, > >> if (!evt) { > >> - vq_err(vq, "Failed to allocate vhost_scsi_evt\n"); > > > > #define vq_err(vq, fmt, ...) do { \ > > pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ > > if ((vq)->error_ctx) \ > > eventfd_signal((vq)->error_ctx, 1);\ > > } while (0) > > > > You silently dropped the eventfd_signal() call. > > Do you prefer to preserve this special error handling then?Yes, please leave vq_err() calls. Stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20170522/d25ae000/attachment-0001.sig>
SF Markus Elfring
2017-May-22 11:34 UTC
vhost/scsi: Delete error messages for failed memory allocations in five functions
>> Do you find information from a Linux allocation failure report sufficient >> for any function implementations here? > > If kmalloc() and friends guarantee to print a warning and backtrace on > every allocation failure, then there's no need for error messages in > callers. > > That seems like good justification that can go in the commit > description, but I'm not sure if kmalloc() and friends guarantee to show > a message (not just the first time, but for every failed allocation)?I am also looking for a more complete and easier accessible documentation for this aspect of the desired exception handling. How would we like to resolve any remaining open issues there? Regards, Markus
Dan Carpenter
2017-May-22 12:38 UTC
[PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions
On Mon, May 22, 2017 at 12:23:20PM +0100, Stefan Hajnoczi wrote:> I'm not sure if kmalloc() and friends guarantee to show > a message (not just the first time, but for every failed allocation)? >It prints multiple times, but it's ratelimited. It can also be disabled using a config option. See slab_out_of_memory(). regards, dan carpenter
Stefan Hajnoczi
2017-May-22 14:08 UTC
[PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions
On Mon, May 22, 2017 at 03:38:33PM +0300, Dan Carpenter wrote:> On Mon, May 22, 2017 at 12:23:20PM +0100, Stefan Hajnoczi wrote: > > I'm not sure if kmalloc() and friends guarantee to show > > a message (not just the first time, but for every failed allocation)? > > > > It prints multiple times, but it's ratelimited. It can also be disabled > using a config option. > > See slab_out_of_memory().Thanks! Stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20170522/8cdbe379/attachment.sig>
Stefan Hajnoczi
2017-May-22 14:09 UTC
vhost/scsi: Delete error messages for failed memory allocations in five functions
On Mon, May 22, 2017 at 01:34:34PM +0200, SF Markus Elfring wrote:> >> Do you find information from a Linux allocation failure report sufficient > >> for any function implementations here? > > > > If kmalloc() and friends guarantee to print a warning and backtrace on > > every allocation failure, then there's no need for error messages in > > callers. > > > > That seems like good justification that can go in the commit > > description, but I'm not sure if kmalloc() and friends guarantee to show > > a message (not just the first time, but for every failed allocation)? > > I am also looking for a more complete and easier accessible documentation > for this aspect of the desired exception handling. > How would we like to resolve any remaining open issues there?No objection from me but please make sure to keep vq_err(). Stefan -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20170522/a31a537f/attachment.sig>
Maybe Matching Threads
- vhost/scsi: Delete error messages for failed memory allocations in five functions
- vhost/scsi: Delete error messages for failed memory allocations in five functions
- [PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions
- [PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions
- [PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions