On Fri, Sep 24, 2010 at 08:01:19PM +0000, Thordur Bjornsson wrote:
> Hi,
> 
>     hitting some panics coming through the swap code and it is a bit
>     annoying having them not show up in the ddb trace.

I actually went through and de-static'ed the uvm code entirely a while
ago; oga was too much of a pussy to ok it, though.

just finish out the entirety of uvm for that, and I'll say yes, if
oga can sack up this time.

> 
>     OK ?
> 
> Index: uvm/uvm_swap.c
> ===================================================================
> RCS file: /home/cvs/src/sys/uvm/uvm_swap.c,v
> retrieving revision 1.97
> diff -u -p -r1.97 uvm_swap.c
> --- uvm/uvm_swap.c    10 Sep 2010 16:34:09 -0000      1.97
> +++ uvm/uvm_swap.c    24 Sep 2010 19:53:22 -0000
> @@ -218,11 +218,11 @@ struct pool vndbuf_pool;
>  /*
>   * local variables
>   */
> -static struct extent *swapmap;               /* controls the mapping of 
> /dev/drum */
> +struct extent *swapmap;              /* controls the mapping of /dev/drum */
>  
>  /* list of all active swap devices [by priority] */
>  LIST_HEAD(swap_priority, swappri);
> -static struct swap_priority swap_priority;
> +struct swap_priority swap_priority;
>  
>  /* locks */
>  struct rwlock swap_syscall_lock = RWLOCK_INITIALIZER("swplk");
> @@ -230,25 +230,25 @@ struct rwlock swap_syscall_lock = RWLOCK
>  /*
>   * prototypes
>   */
> -static void           swapdrum_add(struct swapdev *, int);
> -static struct swapdev        *swapdrum_getsdp(int);
> +void          swapdrum_add(struct swapdev *, int);
> +struct swapdev       *swapdrum_getsdp(int);
>  
> -static struct swapdev        *swaplist_find(struct vnode *, int);
> -static void           swaplist_insert(struct swapdev *, 
> -                                          struct swappri *, int);
> -static void           swaplist_trim(void);
> +struct swapdev       *swaplist_find(struct vnode *, int);
> +void          swaplist_insert(struct swapdev *, 
> +                                  struct swappri *, int);
> +void          swaplist_trim(void);
>  
> -static int swap_on(struct proc *, struct swapdev *);
> -static int swap_off(struct proc *, struct swapdev *);
> +int swap_on(struct proc *, struct swapdev *);
> +int swap_off(struct proc *, struct swapdev *);
>  
> -static void sw_reg_strategy(struct swapdev *, struct buf *, int);
> +void sw_reg_strategy(struct swapdev *, struct buf *, int);
>  void sw_reg_iodone(struct buf *);
>  void sw_reg_iodone_internal(void *, void *);
> -static void sw_reg_start(struct swapdev *);
> +void sw_reg_start(struct swapdev *);
>  
> -static int uvm_swap_io(struct vm_page **, int, int, int);
> +int uvm_swap_io(struct vm_page **, int, int, int);
>  
> -static void swapmount(void);
> +void swapmount(void);
>  boolean_t uvm_swap_allocpages(struct vm_page **, int);
>  
>  #ifdef UVM_SWAP_ENCRYPT
> @@ -481,7 +481,7 @@ uvm_swap_finicrypt_all(void)
>   *   FREE it if we don't need it... this it to prevent malloc blocking
>   *   here while adding swap)
>   */
> -static void
> +void
>  swaplist_insert(struct swapdev *sdp, struct swappri *newspp, int priority)
>  {
>       struct swappri *spp, *pspp;
> @@ -533,7 +533,7 @@ swaplist_insert(struct swapdev *sdp, str
>   * => caller must hold both swap_syscall_lock and uvm.swap_data_lock
>   * => we return the swapdev we found (and removed)
>   */
> -static struct swapdev *
> +struct swapdev *
>  swaplist_find(struct vnode *vp, boolean_t remove)
>  {
>       struct swapdev *sdp;
> @@ -566,7 +566,7 @@ swaplist_find(struct vnode *vp, boolean_
>   *
>   * => caller must hold both swap_syscall_lock and uvm.swap_data_lock
>   */
> -static void
> +void
>  swaplist_trim(void)
>  {
>       struct swappri *spp, *nextspp;
> @@ -587,7 +587,7 @@ swaplist_trim(void)
>   * => caller must hold swap_syscall_lock
>   * => uvm.swap_data_lock should be unlocked (we may sleep)
>   */
> -static void
> +void
>  swapdrum_add(struct swapdev *sdp, int npages)
>  {
>       u_long result;
> @@ -607,7 +607,7 @@ swapdrum_add(struct swapdev *sdp, int np
>   * => each swapdev takes one big contig chunk of the drum
>   * => caller must hold uvm.swap_data_lock
>   */
> -static struct swapdev *
> +struct swapdev *
>  swapdrum_getsdp(int pgno)
>  {
>       struct swapdev *sdp;
> @@ -895,7 +895,7 @@ out:
>   * => caller should leave uvm.swap_data_lock unlocked, we may lock it
>   *   if needed.
>   */
> -static int
> +int
>  swap_on(struct proc *p, struct swapdev *sdp)
>  {
>       static int count = 0;   /* static */
> @@ -1094,7 +1094,7 @@ bad:
>   *
>   * => swap data should be locked, we will unlock.
>   */
> -static int
> +int
>  swap_off(struct proc *p, struct swapdev *sdp)
>  {
>       int error = 0;
> @@ -1243,7 +1243,7 @@ swstrategy(struct buf *bp)
>  /*
>   * sw_reg_strategy: handle swap i/o to regular files
>   */
> -static void
> +void
>  sw_reg_strategy(struct swapdev *sdp, struct buf *bp, int bn)
>  {
>       struct vnode    *vp;
> @@ -1416,7 +1416,7 @@ out: /* Arrive here at splbio */
>  }
>  
>  /* sw_reg_start: start an I/O request on the requested swapdev. */
> -static void
> +void
>  sw_reg_start(struct swapdev *sdp)
>  {
>       struct buf      *bp;
> @@ -1762,7 +1762,7 @@ uvm_swap_get(struct vm_page *page, int s
>   * uvm_swap_io: do an i/o operation to swap
>   */
>  
> -static int
> +int
>  uvm_swap_io(struct vm_page **pps, int startslot, int npages, int flags)
>  {
>       daddr64_t startblk;
> @@ -2086,7 +2086,7 @@ uvm_swap_io(struct vm_page **pps, int st
>       return (result);
>  }
>  
> -static void
> +void
>  swapmount(void)
>  {
>       struct swapdev *sdp;

Reply via email to