All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 2/3] lib: rename ltp_clone_malloc to ltp_clone_alloc
Date: Thu, 13 Jun 2019 16:55:19 +0800	[thread overview]
Message-ID: <CAEemH2f_oMYubEDLdOmhxrEguKkc+3smx682LF7D9uiwZ26OAQ@mail.gmail.com> (raw)
In-Reply-To: <fd8b05453a0c72f2810a53e49ca1dc9467d9dbf9.1560410182.git.jstancek@redhat.com>

On Thu, Jun 13, 2019 at 3:25 PM Jan Stancek <jstancek@redhat.com> wrote:

> There are no users outside of lib.
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
>  include/tst_clone.h | 2 +-
>  lib/cloner.c        | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/tst_clone.h b/include/tst_clone.h
> index 786cee5d1209..fd52097e2072 100644
> --- a/include/tst_clone.h
> +++ b/include/tst_clone.h
> @@ -29,7 +29,7 @@ int ltp_clone(unsigned long flags, int (*fn)(void *arg),
> void *arg,
>                 size_t stack_size, void *stack);
>  int ltp_clone7(unsigned long flags, int (*fn)(void *arg), void *arg,
>                 size_t stack_size, void *stack, ...);
> -int ltp_clone_malloc(unsigned long clone_flags, int (*fn)(void *arg),
> +int ltp_clone_alloc(unsigned long clone_flags, int (*fn)(void *arg),
>                 void *arg, size_t stacksize);
>  int ltp_clone_quick(unsigned long clone_flags, int (*fn)(void *arg),
>                 void *arg);
> diff --git a/lib/cloner.c b/lib/cloner.c
> index cf37184aa22a..8469745d004b 100644
> --- a/lib/cloner.c
> +++ b/lib/cloner.c
> @@ -135,11 +135,11 @@ void *ltp_alloc_stack(size_t size)
>  }
>
>  /*
> - * ltp_clone_malloc: also does the memory allocation for clone with a
> + * ltp_clone_alloc: also does the memory allocation for clone with a
>   * caller-specified size.
>   */
>  int
> -ltp_clone_malloc(unsigned long clone_flags, int (*fn) (void *arg), void
> *arg,
> +ltp_clone_alloc(unsigned long clone_flags, int (*fn) (void *arg), void
> *arg,
>                  size_t stack_size)
>  {
>         void *stack;
> @@ -162,7 +162,7 @@ ltp_clone_malloc(unsigned long clone_flags, int (*fn)
> (void *arg), void *arg,
>  }
>
>  /*
> - * ltp_clone_quick: calls ltp_clone_malloc with predetermined stack size.
> + * ltp_clone_quick: calls ltp_clone_alloc with predetermined stack size.
>   * Experience thus far suggests that one page is often insufficient,
>   * while 6*getpagesize() seems adequate.
>   */
> @@ -170,5 +170,5 @@ int ltp_clone_quick(unsigned long clone_flags, int
> (*fn) (void *arg), void *arg)
>  {
>         size_t stack_size = getpagesize() * 6;
>
> -       return ltp_clone_malloc(clone_flags, fn, arg, stack_size);
> +       return ltp_clone_alloc(clone_flags, fn, arg, stack_size);
>  }
>

There is another legacy problem maybe we need take care.

Any thought about how releasing the stack memory[1] after calling
ltp_clone_quick() in a test?

[1] which allocated memory in ltp_clone_alloc().

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190613/56fd0c52/attachment-0001.html>

  reply	other threads:[~2019-06-13  8:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13  7:23 [LTP] [PATCH v3 1/3] lib: add ltp_alloc_stack() Jan Stancek
2019-06-13  7:24 ` [LTP] [PATCH v3 2/3] lib: rename ltp_clone_malloc to ltp_clone_alloc Jan Stancek
2019-06-13  8:55   ` Li Wang [this message]
2019-06-13 13:57     ` Cyril Hrubis
2019-06-14  2:46       ` Li Wang
2019-06-14 15:24         ` Cyril Hrubis
2019-06-13  7:24 ` [LTP] [PATCH v3 3/3] syscalls/ioctl_ns0[156]: align stack and wait for child Jan Stancek
2019-06-13  8:25   ` Li Wang
2019-06-13 10:16     ` Jan Stancek
2019-06-13 11:26       ` Li Wang
2019-06-13 14:17       ` Cyril Hrubis
2019-06-13 14:57         ` Jan Stancek
2019-06-13 15:14           ` Cyril Hrubis
2019-06-16  7:34             ` Jan Stancek
2019-06-17  8:50               ` Cyril Hrubis
2019-06-17 14:38                 ` Jan Stancek
2019-06-18 16:00                   ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEemH2f_oMYubEDLdOmhxrEguKkc+3smx682LF7D9uiwZ26OAQ@mail.gmail.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.