From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Alberto Garcia <berto@igalia.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: Swap request limit definitions
Date: Wed, 15 Feb 2017 17:44:51 +0100 [thread overview]
Message-ID: <20170215164451.GH4935@noname.redhat.com> (raw)
In-Reply-To: <7fcba84d-4cd8-b34d-ef3e-4fbfa46d59a9@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1265 bytes --]
Am 15.02.2017 um 14:42 hat Max Reitz geschrieben:
> On 14.02.2017 10:52, Alberto Garcia wrote:
> > On Mon 13 Feb 2017 06:13:38 PM CET, Max Reitz wrote:
> >
> >>>> -#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \
> >>>> - INT_MAX >> BDRV_SECTOR_BITS)
> >>>> -#define BDRV_REQUEST_MAX_BYTES (BDRV_REQUEST_MAX_SECTORS << BDRV_SECTOR_BITS)
> >>>> +#define BDRV_REQUEST_MAX_BYTES MIN(SIZE_MAX, INT_MAX)
> >>>> +#define BDRV_REQUEST_MAX_SECTORS (BDRV_REQUEST_MAX_BYTES >> BDRV_SECTOR_BITS)
> >>>
> >>> I'm just pointing it out because I don't know if this can cause
> >>> problems, but this patch would make BDRV_REQUEST_MAX_BYTES not a
> >>> multiple of the sector size (INT_MAX is actually a prime number).
> >>
> >> Very good point. I don't think this could be an issue, though. For one
> >> thing, the use of BDRV_REQUEST_MAX_BYTES is very limited.
> >
> > Ok, but then I wonder what's the benefit of increasing
> > BDRV_REQUEST_MAX_BYTES.
>
> The benefit is that the definition looks cleaner.
Whatever way we want to write it, I think MAX_BYTES = MAX_SECTORS * 512
should be a given. Everything else is bound to confuse people and
introduce bugs sooner or later.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2017-02-15 16:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 1:47 [Qemu-devel] [PATCH] block: Swap request limit definitions Max Reitz
2017-02-13 5:52 ` Fam Zheng
2017-02-13 8:39 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2017-02-13 17:13 ` Max Reitz
2017-02-14 9:52 ` Alberto Garcia
2017-02-15 13:42 ` Max Reitz
2017-02-15 16:44 ` Kevin Wolf [this message]
2017-02-15 16:48 ` Max Reitz
2017-02-15 17:10 ` Kevin Wolf
2017-02-15 17:15 ` Max Reitz
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=20170215164451.GH4935@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=berto@igalia.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).