Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646763

Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions

From Stefan Hajnoczi <stefanha@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory allocations in five functions
Date 2017-05-22 13:30 +0200
Message-ID <tJTHc-53X-27@gated-at.bofh.it> (permalink)
References <tJdHX-2Fl-5@gated-at.bofh.it> <tJdHX-2Fl-13@gated-at.bofh.it> <tJS8r-41t-29@gated-at.bofh.it> <tJTe9-4Fe-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] vhost/scsi: Adjustments for five function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 16:40 +0200
  [PATCH 2/2] vhost/scsi: Delete error messages for failed memory  allocations in five functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 16:40 +0200
    Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory  allocations in five functions Stefan Hajnoczi <stefanha@gmail.com> - 2017-05-22 11:50 +0200
      Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory  allocations in five functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 13:00 +0200
        Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory  allocations in five functions Stefan Hajnoczi <stefanha@gmail.com> - 2017-05-22 13:30 +0200
          Re: vhost/scsi: Delete error messages for failed memory allocations  in five functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 13:40 +0200
            Re: vhost/scsi: Delete error messages for failed memory allocations  in five functions Stefan Hajnoczi <stefanha@gmail.com> - 2017-05-22 16:20 +0200
              Re: vhost/scsi: Delete error messages for failed memory allocations  in five functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 16:30 +0200
          Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory  allocations in five functions Dan Carpenter <dan.carpenter@oracle.com> - 2017-05-22 14:40 +0200
            Re: [PATCH 2/2] vhost/scsi: Delete error messages for failed memory  allocations in five functions Stefan Hajnoczi <stefanha@gmail.com> - 2017-05-22 16:10 +0200
  [PATCH 1/2] vhost/scsi: Improve a size determination in four  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-20 16:40 +0200
    Re: [PATCH 1/2] vhost/scsi: Improve a size determination in four  functions Stefan Hajnoczi <stefanha@gmail.com> - 2017-05-22 11:40 +0200

csiph-web