All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Cc: Ian Jackson <iwj@xenproject.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Ping: [PATCH] gnttab: don't allocate status frame tracking array when "gnttab=max_ver:1"
Date: Fri, 20 Nov 2020 13:50:00 +0100	[thread overview]
Message-ID: <cfce3be1-c742-72b4-5a39-5b374d27705c@suse.com> (raw)
In-Reply-To: <a484cc88-f41d-5d38-d098-4eda297569a1@suse.com>

On 05.11.2020 16:55, Jan Beulich wrote:
> This array can be large when many grant frames are permitted; avoid
> allocating it when it's not going to be used anyway. Do so indirectly
> though, by making grant_to_status_frames() return zero in this case.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Ping?

> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -446,11 +446,14 @@ static inline void active_entry_release(
>  
>  static inline unsigned int grant_to_status_frames(unsigned int grant_frames)
>  {
> +    if ( opt_gnttab_max_version < 2 )
> +        return 0;
>      return DIV_ROUND_UP(grant_frames * GRANT_PER_PAGE, GRANT_STATUS_PER_PAGE);
>  }
>  
>  static inline unsigned int status_to_grant_frames(unsigned int status_frames)
>  {
> +    ASSERT(opt_gnttab_max_version >= 2);
>      return DIV_ROUND_UP(status_frames * GRANT_STATUS_PER_PAGE, GRANT_PER_PAGE);
>  }
>  
> 



  reply	other threads:[~2020-11-20 12:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 15:55 [PATCH] gnttab: don't allocate status frame tracking array when "gnttab=max_ver:1" Jan Beulich
2020-11-20 12:50 ` Jan Beulich [this message]
2020-12-02 18:31 ` Julien Grall
2020-12-04 10:02   ` Jan Beulich

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=cfce3be1-c742-72b4-5a39-5b374d27705c@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 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.