lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230919135536.2165715-1-da.gomez@samsung.com>
Date:   Tue, 19 Sep 2023 13:55:44 +0000
From:   Daniel Gomez <da.gomez@...sung.com>
To:     "minchan@...nel.org" <minchan@...nel.org>,
        "senozhatsky@...omium.org" <senozhatsky@...omium.org>,
        "axboe@...nel.dk" <axboe@...nel.dk>,
        "djwong@...nel.org" <djwong@...nel.org>,
        "willy@...radead.org" <willy@...radead.org>,
        "hughd@...gle.com" <hughd@...gle.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "mcgrof@...nel.org" <mcgrof@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
CC:     "gost.dev@...sung.com" <gost.dev@...sung.com>,
        Pankaj Raghav <p.raghav@...sung.com>,
        Daniel Gomez <da.gomez@...sung.com>
Subject: [PATCH v2 0/6] shmem: high order folios support in write path

This series add support for high order folios in shmem write
path when swap is disabled (noswap option). This is part of the Large
Block Size (LBS) effort [1][2] and a continuation of the shmem work
from Luis here [3] following Matthew Wilcox's suggestion [4] regarding
the path to take for the folio allocation order calculation.

[1] https://kernelnewbies.org/KernelProjects/large-block-size
[2] https://docs.google.com/spreadsheets/d/e/2PACX-1vS7sQfw90S00l2rfOKm83Jlg0px8KxMQE4HHp_DKRGbAGcAV-xu6LITHBEc4xzVh9wLH6WM2lR0cZS8/pubhtml#
[3] RFC v2 add support for blocksize > PAGE_SIZE
https://lore.kernel.org/all/ZHBowMEDfyrAAOWH@bombadil.infradead.org/T/#md3e93ab46ce2ad9254e1eb54ffe71211988b5632
[4] https://lore.kernel.org/all/ZHD9zmIeNXICDaRJ@casper.infradead.org/

fsx and fstests has been performed on tmpfs with noswap with the
following results:
V2:
- fsx: 4,9B
- fstests: Same result as baseline for next-230918.
V1:
- fsx: 2d test, 21,5B
- fstests: Same result as baseline for next-230911 [3][4][5]

Patches have been tested and sent from next-230918.

[3] Baseline next-230911 failures are: generic/080 generic/126
generic/193 generic/633 generic/689
[4] fstests logs baseline: https://gitlab.com/-/snippets/3598621
[5] fstests logs patches: https://gitlab.com/-/snippets/3598628

Note: because of next-230918 regression in rmap, patch [8] applied.

[8] 20230918151729.5A1F4C32796@...p.kernel.org

Daniel

Changes since v1
* Order handling code simplified in shmem_get_folio_gfp after Matthew Willcox's
review.
* Drop patch 1/6 [6] and merge mapping_size_order code directly in shmem.
* Added MAX_SHMEM_ORDER to make it explicit we don't have the same max order as
in pagecache (MAX_PAGECACHE_ORDER).
* Use HPAGE_PMD_ORDER-1 as MAX_SHMEM_ORDER to respect huge mount option.
* Update cover letter: drop huge strategy question and add more context regarding
LBS project. Add fsx and fstests summary with new baseline.
* Add fixes found by Matthew in patch 3/6 [7].
* Fix length (i_size_read -> PAGE_SIZE) that is passed to shmem_get_folio_gfp in
shmem_fault and shmem_read_folio_gfp to PAGE_SIZE.
* Add patch as suggested by Matthew to return the number of pages freed in
shmem_free_swap (instead of errno). When no pages are freed, return 0 (pages).
Note: As an alternative, we can embed -ENOENT and make use of IS_ERR_VALUE.
Approach discarded because little value was added. If this method is preferred,
please let discuss it.

[6] filemap: make the folio order calculation shareable
[7] shmem: account for large order folios

Daniel Gomez (5):
  shmem: drop BLOCKS_PER_PAGE macro
  shmem: return freed pages in shmem_free_swap
  shmem: add order parameter support to shmem_alloc_folio
  shmem: add file length in shmem_get_folio path
  shmem: add large folios support to the write path

Luis Chamberlain (1):
  shmem: account for large order folios

 include/linux/shmem_fs.h |   2 +-
 mm/khugepaged.c          |   2 +-
 mm/shmem.c               | 141 ++++++++++++++++++++++++++-------------
 3 files changed, 97 insertions(+), 48 deletions(-)

--
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ