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


Groups > linux.kernel > #1434800

Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer.

From Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer.
Date 2016-06-30 21:20 +0200
Message-ID <rPPFf-526-3@gated-at.bofh.it> (permalink)
References <rMzQl-1Gf-3@gated-at.bofh.it> <rPLLj-2HF-5@gated-at.bofh.it> <rPMxI-2YZ-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am Donnerstag, 30 Juni 2016, 12:49:44 schrieb Thiago Jung Bauermann:
> Am Donnerstag, 30 Juni 2016, 11:07:00 schrieb Dave Young:
> > On 06/29/16 at 06:18pm, Thiago Jung Bauermann wrote:
> > > I'm not following. The IMA buffer patchset doesn't use
> > > kexec_locate_mem_hole nor struct kexec_buf.
> > 
> > It does not use kexec_locate_mem_hole, but the buffer being passed is
> > very similar to a kexec_buf struct, no?
> 
> If what you're saying is that the arguments passed to
> kexec_add_handover_buffer in the IMA buffer patchset are very similar to
> the arguments passed to kexec_add_buffer then yes, it's true.
> 
> > So you may refactor kexec_add_buffer and your new function to pass only
> > kimage and a kbuf, it will be better than passing all those arguments
> > separately.
> 
> To be honest I think struct kexec_buf is an implementation detail inside
> kexec_locate_mem_hole, made necessary because the callback functions it
> uses need to access its arguments. Callers of kexec_locate_mem_hole,
> kexec_add_handover_buffer and kexec_add_buffer shouldn't need to know it
> exists.

Elaborating a bit more: the argument list for these three functions are 
equal or similar because kexec_add_handover_buffer uses kexec_add_buffer, 
which uses kexec_locate_mem_hole.

It could be beneficial to have a struct to collect the arguments to these 
functions if someone using one of them would be likely to use another one 
with the same arguments. In that case, you set up kexec_buf once and then 
just pass it whenever you need to call one of those functions.

But that is unlikely to happen. A user of the kexec API will need to use 
only one of these functions with a given set of arguments, so they don't 
gain anything by setting up a struct.

Syntactically, I also don't think it's clearer to set struct members instead 
of simply passing arguments to a function, even if the argument list is 
long.

[]'s
Thiago Jung Bauermann
IBM Linux Technology Center

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


Thread

Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-06-29 00:20 +0200
  Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Dave Young <dyoung@redhat.com> - 2016-06-29 21:50 +0200
    Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-06-29 23:30 +0200
      Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Dave Young <dyoung@redhat.com> - 2016-06-30 17:10 +0200
        Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-06-30 18:00 +0200
          Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-06-30 21:20 +0200
            Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Dave Young <dyoung@redhat.com> - 2016-06-30 23:50 +0200
              Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-07-01 20:00 +0200
                Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Dave Young <dyoung@redhat.com> - 2016-07-01 20:50 +0200
                Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-07-01 22:20 +0200
                Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> - 2016-07-02 03:30 +0200
                Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer. Dave Young <dyoung@redhat.com> - 2016-07-05 03:00 +0200

csiph-web