search for: align_pages_up

Displaying 2 results from an estimated 2 matches for "align_pages_up".

2023 Aug 29
2
[PATCH] virtio_balloon: Fix endless deflation and inflation on arm64
...irtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 5b15936a5214..625caac35264 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -386,6 +386,17 @@ static void stats_handle_request(struct virtio_balloon *vb) virtqueue_kick(vq); } +static inline s64 align_pages_up(s64 diff) +{ + if (diff == 0) + return diff; + + if (diff > 0) + return ALIGN(diff, VIRTIO_BALLOON_PAGES_PER_PAGE); + + return -ALIGN(-diff, VIRTIO_BALLOON_PAGES_PER_PAGE); +} + static inline s64 towards_target(struct virtio_balloon *vb) { s64 target; @@ -396,7 +407,7 @@ static inline s64...
2023 Aug 30
1
[PATCH] virtio_balloon: Fix endless deflation and inflation on arm64
...tio_balloon.c > index 5b15936a5214..625caac35264 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -386,6 +386,17 @@ static void stats_handle_request(struct virtio_balloon *vb) > virtqueue_kick(vq); > } > > +static inline s64 align_pages_up(s64 diff) > +{ > + if (diff == 0) > + return diff; > + > + if (diff > 0) > + return ALIGN(diff, VIRTIO_BALLOON_PAGES_PER_PAGE); > + > + return -ALIGN(-diff, VIRTIO_BALLOON_PAGES_PER_PAGE); > +} > + > static inline s64 towards_target(struct virtio_balloon *vb)...