home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / aix / 13608 < prev    next >
Encoding:
Text File  |  1993-01-21  |  5.4 KB  |  114 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!daffy!uwvax!ssec.wisc.edu!steves
  3. From: steves@ssec.wisc.edu (Steve Shirshac)
  4. Subject: Problem with AIX3.2 paging subsystem?
  5. Message-ID: <1993Jan21.230535.4139@cs.wisc.edu>
  6. Summary: pager from hell
  7. Sender: news@cs.wisc.edu (The News)
  8. Organization: UW-Madison Space Science and Engineering Center
  9. Date: Thu, 21 Jan 1993 23:05:35 GMT
  10. Lines: 102
  11.  
  12. I think I may have found a problem in the AIX 3.2 paging subsystem.  If
  13. you have any experience with developing device drivers for AIX, I would
  14. appreciate any insights you might have into this problem or how to
  15. isolate it further.  A rather detailed description follows.
  16.  
  17. background/demographics:
  18.  
  19.         We have an IBM RISC/6000 model 520h with 32 Mb of physical memory,
  20.         AIX 3.2, and 64 Mb of page/swap space configured.
  21.  
  22.         We have developed an adapter card which now sits on the MicroChannel
  23.         bus and for which I have written a device driver.
  24.         Our adapter reads a high speed stream of data from an external
  25.         device and blocks it up to perform slave DMA transfers.
  26.  
  27. problem description:
  28.  
  29.         My device driver for this adapter seems to perform correctly in
  30.         all major aspects but one.  Once my device driver is configured
  31.         into the AIX kernel, I run a root privileged process to open the
  32.         device, read data from the device into a very large buffer allo-
  33.         cated from shared memory, and close the device once I've read
  34.         enough data.  Fine so far - all works OK.  I can execute this root
  35.         process exactly four times and then the machine runs out of swap
  36.         space.  AIX then starts killing processes to start a new one and
  37.         also complains that there's not enough...            swap space.
  38.  
  39.         It appears that there is either a problem with (1) the AIX kernel's
  40.     paging subsystem or (2) my device driver.
  41.  
  42.         The Swapper apparently is having a problem trying to reuse the
  43.         space used to back the memory touched by the root processes which
  44.         have run and completed.  It still thinks that it needs to keep track
  45.         of those used memory pages and thus runs out of space when it hits
  46.         the 64MB limit for which it is configured.
  47.  
  48.         On the other hand, and most likely, the problem could be the way
  49.         in which my device driver handles the memory that it touches.
  50.  
  51.         The short version is:
  52.            The root process (call it "fred") allocates a 16Mb hunk of
  53.            shared memory. "fred" then call a kernel extension to pin this
  54.            shared memory hunk. "fred" then opens my device driver, tells
  55.            it the starting location of the shared memory and a block size,
  56.            and lets the device driver fill the shared memory with data.
  57.            Once the shared memory is filled and "fred" is happy with it,
  58.            "fred" closes the device, unpins (via kernel extension) the
  59.            shared memory hunk, and releases the shared memory and term-
  60.            inates.  At this point, the system seems to think that the shared
  61.            memory (16MB) is indeed unpinned and free but the swapper seems
  62.            to think that it still needs to be backed.
  63.  
  64.  
  65.         The long version follows:
  66.  
  67.            privileged user process ("fred") allocates a large shared mem
  68.            segment (16Mb), "fred" pins shared mem seg, "fred" opens our
  69.            device and passes a pointer to the shared mem seg to my device
  70.            driver.
  71.  
  72.            device driver receives pointer to shared mem segment start.
  73.  
  74.            Device driver then attaches cross memory descriptors to each of
  75.            1024 16384-byte blocks ("arbitrarily" chosen buffer size) blocks
  76.            which comprise the 16Mb shared mem seg.
  77.  
  78.            (this is done so that hardware can perform DMA transfers to the
  79.            individual 1024 blocks within the shared mem seg. and so that we
  80.            can still allow viewing access to individual blocks that have
  81.            been filled with data while the remainder of the blocks are
  82.            being filled with data from the adapter.)
  83.            DMA transfers occur (from our hardware to shared mem seg blocks)
  84.            cyclically through the 1024 blocks in shared mem seg. (i.e.,
  85.            DMA transfers occur sequentially, starting with block 0 in the
  86.            shared mem segment and increasing through block 1023.  Once block
  87.            1023 is filled  via DMA transfer of 16384 bytes, we start anew with
  88.            block 0.)
  89.            Upon close of device, DMA transfers are halted and attached cross
  90.            memory descriptors are released.
  91.  
  92.            privileged user process then unpins the shared mem seg and
  93.            deallocates it.
  94.  
  95.  
  96.            upon privileged user process completion:
  97.  
  98.               "svmon" indicates that the pages used to back the shared mem
  99.                       segment have been unpinned.
  100.  
  101.               "ipcs" indicates that the shared memory segments which were
  102.                      being used are no longer there.
  103.  
  104.               "lsps -a" indicates that swap space usage has increased by 16Mb.
  105.  
  106.               low-level kernel debugger indicates that there are 0 pages of
  107.                      memory that have a xmemcnt > 0.
  108.  
  109. If the problem is not in the OS, then what could I be doing wrong in
  110. the device driver?  I've exhausted the 'Writing Device Drivers for
  111. AIX3.2' documentation, and found nothing there to help.
  112.  
  113. Steve Shirshac (steves@ssecmail.ssec.wisc.edu)
  114.