MFC r349432:Add a return value to vm_page_remove().
MFC r348785:Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).
Revert drm2 removal.Revert r338177, r338176, r338175, r338174, r338172After long consultations with re@, core members and mmacy, revertthese changes. Followup changes will be made to mark them a
Revert drm2 removal.Revert r338177, r338176, r338175, r338174, r338172After long consultations with re@, core members and mmacy, revertthese changes. Followup changes will be made to mark them asdeprecated and prent a message about where to find the up-to-datedriver. Followup commits will be made to make this clear in theinstaller. Followup commits to reduce POLA in ways we're stillexploring.It's anticipated that after the freeze, this will be removed in13-current (with the residual of the drm2 code copied tosys/arm/dev/drm2 for the TEGRA port's use w/o the intel orradeon drivers).Due to the impending freeze, there was no formal core vote forthis. I've been talking to different core members all day, as well asMatt Macey and Glen Barber. Nobody is completely happy, all aregrudgingly going along with this. Work is in progress to mitigatethe negative effects as much as possible.Requested by: re@ (gjb, rgrimes)
show more ...
Remove legacy drm and drm2 from treeAs discussed on the MLs drm2 conflicts with the ports' version and thereis no upstream for most if not all of drm. Both have been merged in toa single port.U
Remove legacy drm and drm2 from treeAs discussed on the MLs drm2 conflicts with the ports' version and thereis no upstream for most if not all of drm. Both have been merged in toa single port.Users on powerpc, 32-bit hardware, or with GPUs predating Radeonand i915 will need to install the graphics/drm-legacy-kmod. Allother users should be able to use one of the LinuxKPI-based ports:graphics/drm-stable-kmod, graphics/drm-next-kmod, graphics/drm-devel-kmod.MFC: neverApproved by: core@
vm_wait() rework.Make vm_wait() take the vm_object argument which specifies the domainset to wait for the min condition pass. If there is no objectassociated with the wait, use curthread' policy
vm_wait() rework.Make vm_wait() take the vm_object argument which specifies the domainset to wait for the min condition pass. If there is no objectassociated with the wait, use curthread' policy domainset. Themechanics of the wait in vm_wait() and vm_wait_domain() is supplied bythe new helper vm_wait_doms(), which directly takes the bitmask of thedomains to wait for passing min condition.Eliminate pagedaemon_wait(). vm_domain_clear() handles the sameoperations.Eliminate VM_WAIT and VM_WAITPFAULT macros, the direct functions callsare enough.Eliminate several control state variables from vm_domain, unneededafter the vm_wait() conversion.Scetched and reviewed by: jeffTested by: phoSponsored by: The FreeBSD Foundation, Mellanox TechnologiesDifferential revision: https://reviews.freebsd.org/D14384
Don't bother enqueuing a page immediately before freeing it.No functional change intended.MFC after: 1 week
Fix a few uses of kern_yield() in the TTM and the LinuxKPI.kern_yield(0) effectively causes the calling thread to be rescheduledimmediately since it resets the thread's priority to the highest pos
Fix a few uses of kern_yield() in the TTM and the LinuxKPI.kern_yield(0) effectively causes the calling thread to be rescheduledimmediately since it resets the thread's priority to the highest possiblevalue. This can cause livelocks when the pattern"while (!trylock()) kern_yield(0);" is used since the thread holding thelock may linger on the runqueue for the CPU on which the looping thread isrunning.MFC after: 1 week
Allow DRM2 code to be built on platforms without AGP.This patch is taken from original drm-3.8 code.Differential Revision: https://reviews.freebsd.org/D8454MFC after: 3 weeks
Fix a race in vm_page_busy_sleep(9).Suppose that we have an exclusively busy page, and a thread which canaccept shared-busy page. In this case, typical code waiting for thepage xbusy state to pa
Fix a race in vm_page_busy_sleep(9).Suppose that we have an exclusively busy page, and a thread which canaccept shared-busy page. In this case, typical code waiting for thepage xbusy state to pass isagain: VM_OBJECT_WLOCK(object); ... if (vm_page_xbusied(m)) { vm_page_lock(m); VM_OBJECT_WUNLOCK(object); <---1 vm_page_busy_sleep(p, "vmopax"); goto again; }Suppose that the xbusy state owner locked the object, unbusied thepage and unlocked the object after we are at the line [1], but before weexecuted the load of the busy_lock word in vm_page_busy_sleep(). If ithappens that there is still no waiters recorded for the busy state,the xbusy owner did not acquired the page lock, so it proceeded.More, suppose that some other thread happen to share-busy the pageafter xbusy state was relinquished but before the m->busy_lock is readin vm_page_busy_sleep(). Again, that thread only needs vm_object lockto proceed. Then, vm_page_busy_sleep() reads busy_lock value equal tothe VPB_SHARERS_WORD(1).In this case, all tests in vm_page_busy_sleep(9) pass and we are goingto sleep, despite the page being share-busied.Update check for m->busy_lock == VPB_UNBUSIED in vm_page_busy_sleep(9)to also accept shared-busy state if we only wait for the xbusy state topass.Merge sequential if()s with the same 'then' clause invm_page_busy_sleep().Note that the current code does not share-busy pages from parallelthreads, the only way to have more that one sbusy owner is right nowis to recurse.Reported and tested by: pho (previous version)Reviewed by: alc, markjSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D8196
sys/dev: minor spelling fixes.Most affect comments, very few have user-visible effects.
etc: minor spelling fixes.Mostly comments but also some user-visible strings.MFC after: 2 weeks
Handle the driver KPI change from r292373. Ensure that managed devicepagers fault routines always return with a result page, be it theproper and valid result page, or initially passed freshly allo
Handle the driver KPI change from r292373. Ensure that managed devicepagers fault routines always return with a result page, be it theproper and valid result page, or initially passed freshly allocatedplaceholder. Do not free the passed in page until we are able toprovide the replacement, and do not assign NULL to *mres.Reported and tested by: dumbbellReviewed by: royger (who also verified that Xen code is safe)Sponsored by: The FreeBSD Foundation
Introduce a new mechanism for relocating virtual pages to a new physicaladdress and use this mechanism when:1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical memory a
Introduce a new mechanism for relocating virtual pages to a new physicaladdress and use this mechanism when:1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical memory allocator's free page lists. This replaces the long-standing approach of scanning the inactive and inactive queues, converting clean pages into PG_CACHED pages and laundering dirty pages. In contrast, the new mechanism does not use PG_CACHED pages nor does it trigger a large number of I/O operations.2. on 32-bit MIPS processors, uma_small_alloc() and the pmap can't find free pages in the physical memory allocator's free page lists that are covered by the direct map. Tested by: adrian3. ttm_bo_global_init() and ttm_vm_page_alloc_dma32() can't find suitable free pages in the physical memory allocator's free page lists.In the coming months, I expect that this new mechanism will be applied inother places. For example, balloon drivers should use relocation tominimize fragmentation of the guest physical address space.Make vm_phys_alloc_contig() a little smarter (and more efficient in somecases). Specifically, use vm_phys_segs[] earlier to avoid scanning freepage lists that can't possibly contain suitable pages.Reviewed by: kib, markjGlanced at: jhbDiscussed with: jeffSponsored by: EMC / Isilon Storage DivisionDifferential Revision: https://reviews.freebsd.org/D4444
A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().o With new KPI consumers can request contiguous ranges of pages, and unlike before, all pages will be kept busied on return,
A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().o With new KPI consumers can request contiguous ranges of pages, and unlike before, all pages will be kept busied on return, like it was done before with the 'reqpage' only. Now the reqpage goes away. With new interface it is easier to implement code protected from race conditions. Such arrayed requests for now should be preceeded by a call to vm_pager_haspage() to make sure that request is possible. This could be improved later, making vm_pager_haspage() obsolete. Strenghtening the promises on the business of the array of pages allows us to remove such hacks as swp_pager_free_nrpage() and vm_pager_free_nonreq().o New KPI accepts two integer pointers that may optionally point at values for read ahead and read behind, that a pager may do, if it can. These pages are completely owned by pager, and not controlled by the caller. This shifts the UFS-specific readahead logic from vm_fault.c, which should be file system agnostic, into vnode_pager.c. It also removes one VOP_BMAP() request per hard fault.Discussed with: kib, alc, jeff, scottlSponsored by: Nginx, Inc.Sponsored by: Netflix
drm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an errorBefore, this was done if `pending` was true. This is not what themanpage suggests and not what was done elsewhere in the sam
drm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an errorBefore, this was done if `pending` was true. This is not what themanpage suggests and not what was done elsewhere in the same file.
ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restrictionThis change re-organizes code a little bit to extract common piecesof ttm_alloc_new_pages() and ttm_get_pages() into dedicat
ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restrictionThis change re-organizes code a little bit to extract common piecesof ttm_alloc_new_pages() and ttm_get_pages() into dedicated functions.Also, for requests without address restrictions regular vm_page_alloc()is used.Lastly, when vm_page_alloc_contig() fails we call VM_WAIT before callingvm_pageout_grow_cache() to ensure that there is enough free pages at all.Reviewed by: kibMFC after: 15 days
drm: Update the device-independent code to match Linux 3.8.13This update brings few features: o Support for the setmaster/dropmaster ioctls. For instance, they are used to run multiple
drm: Update the device-independent code to match Linux 3.8.13This update brings few features: o Support for the setmaster/dropmaster ioctls. For instance, they are used to run multiple X servers simultaneously. o Support for minor devices. The only user-visible change is a new entry in /dev/dri but it is useless at the moment. This is a first step to support render nodes [1].The main benefit is to greatly reduce the diff with Linux (at theexpense of an unreadable commit diff). Hopefully, next upgrades will beeasier.No updates were made to the drivers, beside adapting them to APIchanges.[1] https://en.wikipedia.org/wiki/Direct_Rendering_Manager#Render_nodesTested by: Many peopleMFC after: 1 monthRelnotes: yes
If the vm_page_alloc_contig() failed in the ttm page allocators, dowhat other callers of vm_page_alloc_contig() do, retry aftervm_pageout_grow_cache().Sponsored by: The FreeBSD Foundation
Use default memory type for TTM buffer objects that may be cached.MFC after: 1 week
Port the TTM AGP backend to the FreeBSD agp driver and enable AGP supportin the radeonkms driver.Note: In PCI mode virtual addresses on the graphics card that map to systemRAM are translated to p
Port the TTM AGP backend to the FreeBSD agp driver and enable AGP supportin the radeonkms driver.Note: In PCI mode virtual addresses on the graphics card that map to systemRAM are translated to physical addresses by the graphics card itself. InAGP mode address translation is done by the AGP chipset so fictitiousaddresses appear on the system bus. For the CPU cache management to workcorrectly when the CPU accesses this memory it needs to use the samefictitious addresses (and let the chipset translate them) instead of usingthe physical addresses directly.Reviewed by: kibMFC after: 1 month
drm: fix usage of vm_phys_fictitious_to_vm_pagevm_phys_fictitious_to_vm_page should not be called directly, even whenoperating on a range that has been registered usingvm_phys_fictitious_reg_rang
drm: fix usage of vm_phys_fictitious_to_vm_pagevm_phys_fictitious_to_vm_page should not be called directly, even whenoperating on a range that has been registered usingvm_phys_fictitious_reg_range. PHYS_TO_VM_PAGE should be used insteadbecause on arches that use VM_PHYSSEG_DENSE the page might comedirectly from vm_page_array.Reported by: nwhitehornTested by: nwhitehorn, David Mackay <[email protected]>Sponsored by: Citrix Systems R&D
- Modify vm_page_unwire() and vm_page_enqueue() to directly accept the queue where to enqueue pages that are going to be unwired.- Add stronger checks to the enqueue/dequeue for the pagequeues whe
- Modify vm_page_unwire() and vm_page_enqueue() to directly accept the queue where to enqueue pages that are going to be unwired.- Add stronger checks to the enqueue/dequeue for the pagequeues when adding and removing pages to them.Of course, for unmanaged pages the queue parameter of vm_page_unwire() willbe ignored, just as the active parameter today.This makes adding new pagequeues quicker.This change effectively modifies the KPI. __FreeBSD_version will be,however, bumped just when the full cache of free pages will beevicted.Sponsored by: EMC / Isilon storage divisionReviewed by: alcTested by: pho
drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS...... for msleep/cv_*wait() return values, where wait_event*() is usedon Linux. ERESTARTSYS is the return code expected by callers when t
drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS...... for msleep/cv_*wait() return values, where wait_event*() is usedon Linux. ERESTARTSYS is the return code expected by callers when theoperation was interrupted.For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): ifan error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs anerror.Note that ERESTARTSYS is defined as ERESTART, but this keeps callers'code close to Linux.Submitted by: avg@ (previous version)
ttm_bo_vm_lookup_rb: actually make use of the red-black treePreviously the code would just iterate over the whole tree as if it werejust a list.Without this change I would observe X server becom
ttm_bo_vm_lookup_rb: actually make use of the red-black treePreviously the code would just iterate over the whole tree as if it werejust a list.Without this change I would observe X server becoming more and morejerky over time.MFC after: 5 days
Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisshifts into the sign bit. Instead use (1U << 31) which gets theexpected result.This fix is not ideal as it assumes a 32 bi
Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisshifts into the sign bit. Instead use (1U << 31) which gets theexpected result.This fix is not ideal as it assumes a 32 bit int, but does fix the issuefor most cases.A similar change was made in OpenBSD.Discussed with: -arch, rdivackyReviewed by: cperciva
123