On 8/4/21 8:26 PM, Ming Lei wrote:
On Wed, Aug 04, 2021 at 10:43:05AM -0700, Bart Van Assche wrote:
Thanks for having suggested an alternative. However, isn't the above a
policy? Shouldn't a kernel provide mechanisms instead of policies?
REQ_SWAP means it is one IO written to swap device/file, so the system
is suffering memory pressure, then isn't it reasonable to bypass io
scheduler for all SWAP IOs?
Hmm ... I'm not sure that approach is ideal when swapping to a hard disk.
Additionally, the above patch does not address all Android loop driver use
cases. Reading APEX files is regular I/O and hence REQ_SWAP is not set while
reading from APEX files.
Is APEX file one swap file? If not, can you explain it a bit why you want to
switch to none when reading APEX file?
As far as I know Android uses the loop driver for two purposes:
- A zram instance is used as swap device and the zram instance is
configured to use a loop device.
- apexd mounts APEX files read-only and uses the loop driver to access
these files as a block device.
Bart.