Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] Refactor aiocp using new LTP API
Date: Thu, 28 Jul 2022 15:14:36 +0200	[thread overview]
Message-ID: <YuKLvFspbOmeWhFE@yuki> (raw)
In-Reply-To: <fb6c9172-e6f7-ba33-22fb-b4afae66478a@suse.com>

Hi!
> >> -static struct iocb *alloc_iocb(void)
> >> -{
> >> -	if (!iocb_free_count)
> >> -		return 0;
> >> -	return iocb_free[--iocb_free_count];
> >> -}
> >> +				iosize = MIN(filesize - offset, aio_blksize);
> >>   
> >> -void free_iocb(struct iocb *io)
> >> -{
> >> -	iocb_free[iocb_free_count++] = io;
> >> -}
> > This part was important as well. The I/O requests are not guaranteed to
> > be processed orderly so we stored the pointers of the finished iocb
> > structures in the async_write_done() function by calling this function
> > so that we can reuse them later.
> >
> > I guess that it would be cleaner to rename the functions to something as
> > put_iocb() and get_iocb() since they do not allcate anything but they
> > have to stay.
> Do we really need that? iocb_free buffer is always initialized and we 
> can still use it all.

I guess that you missed the part that there are no guarantees that
submitted iocbs are processed in any order. We cannot simply attempt to
reuse these that are at the beginning of the array passed tot the
io_submit() call.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2022-07-28 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 14:42 [LTP] [PATCH v1] Refactor aiocp using new LTP API Andrea Cervesato via ltp
2022-06-22 14:24 ` Cyril Hrubis
2022-07-26 11:15   ` Andrea Cervesato via ltp
2022-07-28 13:14     ` Cyril Hrubis [this message]

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=YuKLvFspbOmeWhFE@yuki \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox