Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1643050
| From | Chris Wilson <chris@chris-wilson.co.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] drm: replace drm_[cm]alloc* by kvmalloc alternatives |
| Date | 2017-05-17 09:50 +0200 |
| Message-ID | <tI1Sy-ck-11@gated-at.bofh.it> (permalink) |
| References | <tI169-86C-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, May 17, 2017 at 08:55:08AM +0200, Michal Hocko wrote: > From: Michal Hocko <mhocko@suse.com> > > drm_[cm]alloc* has grown their own kvmalloc with vmalloc fallback > implementations. MM has grown kvmalloc* helpers in the meantime. Let's > use those because it a) reduces the code and b) MM has a better idea > how to implement fallbacks (e.g. do not vmalloc before kmalloc is tried > with __GFP_NORETRY). > > drm_calloc_large needs to get __GFP_ZERO explicitly but it is the same > thing as kvmalloc_array in principle. > > Signed-off-by: Michal Hocko <mhocko@suse.com> Just a little surprised that calloc_large users still exist. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> One more feature request from mm, can we have the if (size != 0 && n > SIZE_MAX / size) check exported by itself. It is used by both kvmalloc_array and kmalloc_array, and in my ioctls I have it open-coded as well to differentiate between the -EINVAL (for bogus user values) and genuine -ENOMEM. -Chris -- Chris Wilson, Intel Open Source Technology Centre
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] drm: replace drm_[cm]alloc* by kvmalloc alternatives Michal Hocko <mhocko@kernel.org> - 2017-05-17 09:00 +0200
Re: [PATCH 1/2] drm: replace drm_[cm]alloc* by kvmalloc alternatives Chris Wilson <chris@chris-wilson.co.uk> - 2017-05-17 09:50 +0200
Re: [PATCH 1/2] drm: replace drm_[cm]alloc* by kvmalloc alternatives Michal Hocko <mhocko@kernel.org> - 2017-05-17 11:10 +0200
Re: [PATCH 1/2] drm: replace drm_[cm]alloc* by kvmalloc alternatives Chris Wilson <chris@chris-wilson.co.uk> - 2017-05-17 11:20 +0200
Re: [PATCH 1/2] drm: replace drm_[cm]alloc* by kvmalloc alternatives Michal Hocko <mhocko@kernel.org> - 2017-05-17 11:30 +0200
csiph-web