get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2197836/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2197836,
    "url": "http://patchwork.ozlabs.org/api/patches/2197836/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260218174139.94454-1-mdoucha@suse.cz/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api",
        "name": "Linux Test Project development",
        "link_name": "ltp",
        "list_id": "ltp.lists.linux.it",
        "list_email": "ltp@lists.linux.it",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260218174139.94454-1-mdoucha@suse.cz>",
    "list_archive_url": null,
    "date": "2026-02-18T17:41:38",
    "name": "[v2] readahead02: Always allow at least 100ms for cache to fill",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b97ebc14293a4d7fa38a80ff664181a3921f4434",
    "submitter": {
        "id": 77472,
        "url": "http://patchwork.ozlabs.org/api/people/77472/?format=api",
        "name": "Martin Doucha",
        "email": "mdoucha@suse.cz"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260218174139.94454-1-mdoucha@suse.cz/mbox/",
    "series": [
        {
            "id": 492579,
            "url": "http://patchwork.ozlabs.org/api/series/492579/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=492579",
            "date": "2026-02-18T17:41:38",
            "name": "[v2] readahead02: Always allow at least 100ms for cache to fill",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/492579/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2197836/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2197836/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ltp@lists.linux.it"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ltp@picard.linux.it"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=P4/UwDt+;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.cz\n header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=BgLW0LtI;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa\n header.b=P4/UwDt+;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=BgLW0LtI;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)",
            "smtp-out2.suse.de;\n dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=\"P4/UwDt+\";\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=BgLW0LtI"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGP2m6NNDz1xwC\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 04:41:51 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 984BB3D0719\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Feb 2026 18:41:48 +0100 (CET)",
            "from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id E6A3F3D06F9\n for <ltp@lists.linux.it>; Wed, 18 Feb 2026 18:41:45 +0100 (CET)",
            "from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 3C5ED6009F9\n for <ltp@lists.linux.it>; Wed, 18 Feb 2026 18:41:44 +0100 (CET)",
            "from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id 3E5B35BCF5\n for <ltp@lists.linux.it>; Wed, 18 Feb 2026 17:41:44 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2E51E3EA66\n for <ltp@lists.linux.it>; Wed, 18 Feb 2026 17:41:44 +0000 (UTC)",
            "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id DbcVC9j5lWmvbAAAD6G6ig\n (envelope-from <mdoucha@suse.cz>)\n for <ltp@lists.linux.it>; Wed, 18 Feb 2026 17:41:44 +0000"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1771436504; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=31+rt4gMIghcJzbkrCOBJ7HONIrsG+TXo7kZiEzVxo0=;\n b=P4/UwDt+W7VWYdsIUlUl/D+mjZBmldcDZz3WG0CyB6QnUKdzX1DLO/yta6SbblbJSAyW5B\n 738NF9DiAvXfzlir9jOPT0Md3ddtCJ0E9uQhEQvCWd0ZknPEt8EJZXyIoVLXZH1VR7MoZf\n YFsReeOw+h+BNLE8Bvcapb5X8P3U6Jg=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1771436504;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=31+rt4gMIghcJzbkrCOBJ7HONIrsG+TXo7kZiEzVxo0=;\n b=BgLW0LtIenCrvvO/cUWCjYRI+YowekMMDCMb1rObDYX0UFbRH8prLLF6mWS5RkR8xbTpup\n CB1gmfW4AyInsuDg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1771436504; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=31+rt4gMIghcJzbkrCOBJ7HONIrsG+TXo7kZiEzVxo0=;\n b=P4/UwDt+W7VWYdsIUlUl/D+mjZBmldcDZz3WG0CyB6QnUKdzX1DLO/yta6SbblbJSAyW5B\n 738NF9DiAvXfzlir9jOPT0Md3ddtCJ0E9uQhEQvCWd0ZknPEt8EJZXyIoVLXZH1VR7MoZf\n YFsReeOw+h+BNLE8Bvcapb5X8P3U6Jg=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1771436504;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=31+rt4gMIghcJzbkrCOBJ7HONIrsG+TXo7kZiEzVxo0=;\n b=BgLW0LtIenCrvvO/cUWCjYRI+YowekMMDCMb1rObDYX0UFbRH8prLLF6mWS5RkR8xbTpup\n CB1gmfW4AyInsuDg=="
        ],
        "From": "Martin Doucha <mdoucha@suse.cz>",
        "To": "ltp@lists.linux.it",
        "Date": "Wed, 18 Feb 2026 18:41:38 +0100",
        "Message-ID": "<20260218174139.94454-1-mdoucha@suse.cz>",
        "X-Mailer": "git-send-email 2.52.0",
        "MIME-Version": "1.0",
        "X-Spamd-Result": "default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[];\n R_MISSING_CHARSET(0.50)[];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[];\n RCVD_VIA_SMTP_AUTH(0.00)[];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_ONE(0.00)[1];\n MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[];\n PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it];\n FROM_EQ_ENVFROM(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:mid,suse.cz:dkim,suse.cz:email];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n RCVD_TLS_ALL(0.00)[]; TO_DN_NONE(0.00)[];\n RCVD_COUNT_TWO(0.00)[2];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n DKIM_TRACE(0.00)[suse.cz:+]",
        "X-Rspamd-Action": "no action",
        "X-Spam-Score": "-3.01",
        "X-Spam-Level": "",
        "X-Rspamd-Server": "rspamd1.dmz-prg2.suse.org",
        "X-Rspamd-Queue-Id": "3E5B35BCF5",
        "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-5.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH v2] readahead02: Always allow at least 100ms for cache\n to fill",
        "X-BeenThere": "ltp@lists.linux.it",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux Test Project <ltp.lists.linux.it>",
        "List-Unsubscribe": "<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>",
        "List-Archive": "<http://lists.linux.it/pipermail/ltp/>",
        "List-Post": "<mailto:ltp@lists.linux.it>",
        "List-Help": "<mailto:ltp-request@lists.linux.it?subject=help>",
        "List-Subscribe": "<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it",
        "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"
    },
    "content": "The current wait algorithm for filling the cache after readahead()\nwill never retry if the cache doesn't start filling within 15ms.\nRewrite the wait loop to always allow at least 100ms for the cache\nto fill and exit early only if cache increased by at least half\nof the expected amount. This fixes random test failures if the interval\nbetween cache increases is longer than 5ms.\n\nSigned-off-by: Martin Doucha <mdoucha@suse.cz>\n---\n\nChanges since v1:\n- Renamed MIN_SLEEP_LIMIT to MIN_RETRY_LIMIT\n- Fixed printf format for cached_prev\n- Fixed type issue in cache_diff calculation by casting to ssize_t\n\n .../kernel/syscalls/readahead/readahead02.c   | 45 +++++++++----------\n 1 file changed, 20 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c\nindex 8dbcec2e7..aac412695 100644\n--- a/testcases/kernel/syscalls/readahead/readahead02.c\n+++ b/testcases/kernel/syscalls/readahead/readahead02.c\n@@ -38,8 +38,8 @@ static char testfile[PATH_MAX] = \"testfile\";\n #define DROP_CACHES_FNAME \"/proc/sys/vm/drop_caches\"\n #define PROC_IO_FNAME \"/proc/self/io\"\n #define DEFAULT_FILESIZE (64 * 1024 * 1024)\n-#define INITIAL_SHORT_SLEEP_US 10000\n #define SHORT_SLEEP_US 5000\n+#define MIN_RETRY_LIMIT 20\n \n static size_t testfile_size = DEFAULT_FILESIZE;\n static char *opt_fsizestr;\n@@ -193,12 +193,20 @@ static int read_testfile(struct tcase *tc, int do_readahead,\n \tlong read_bytes_start;\n \tunsigned char *p, tmp;\n \toff_t offset = 0;\n-\tunsigned long cached_prev = 0, cached_cur = 0;\n+\tsize_t cached_prev;\n+\tssize_t cache_diff;\n \n \tfd = SAFE_OPEN(fname, O_RDONLY);\n \n \tif (do_readahead) {\n \t\tdo {\n+\t\t\tcached_prev = get_file_cached_bytes(fname, fsize);\n+\t\t\ttst_res(TDEBUG, \"Per-file cached: %zu kB\",\n+\t\t\t\tcached_prev / 1024);\n+\n+\t\t\tif (cached_prev >= fsize)\n+\t\t\t\tbreak;\n+\n \t\t\tTEST(tc->readahead(fd, offset, fsize - offset));\n \t\t\tif (TST_RET != 0) {\n \t\t\t\tSAFE_CLOSE(fd);\n@@ -207,40 +215,27 @@ static int read_testfile(struct tcase *tc, int do_readahead,\n \n \t\t\ti++;\n \t\t\toffset += readahead_length;\n-\t\t\t/* Wait a bit so that the readahead() has chance to start. */\n-\t\t\tusleep(INITIAL_SHORT_SLEEP_US);\n \t\t\t/*\n \t\t\t * We assume that the worst case I/O speed is around\n-\t\t\t * 5MB/s which is roughly 5 bytes per 1 us, which gives\n+\t\t\t * 5MB/s which is roughly 5 bytes per 1 us and we\n+\t\t\t * allow additional 25ms for seeks, which gives\n \t\t\t * us upper bound for retries that is\n-\t\t\t * readahead_size/(5 * SHORT_SLEEP_US).\n+\t\t\t * 5 + readahead_size/(5 * SHORT_SLEEP_US).\n \t\t\t *\n-\t\t\t * We also monitor the cache size increases before and\n-\t\t\t * after the sleep. With the same assumption about the\n-\t\t\t * speed we are supposed to read at least 5 *\n-\t\t\t * SHORT_SLEEP_US bytes during that time. That amound\n-\t\t\t * is genreally quite close a page size so that we just\n-\t\t\t * assume that we sould continue as long as the cache\n-\t\t\t * increases.\n-\t\t\t *\n-\t\t\t * Of course all of this is inprecise on multitasking\n-\t\t\t * OS however even on a system where there are several\n-\t\t\t * processes figthing for I/O this loop will wait as\n-\t\t\t * long a cache is increasing which will gives us high\n-\t\t\t * chance of waiting for the readahead to happen.\n+\t\t\t * We also monitor the cache size and exit the wait\n+\t\t\t * loop early if it increases by at least 50%\n+\t\t\t * of the read ahead size.\n \t\t\t */\n-\t\t\tcached_cur = get_file_cached_bytes(fname, fsize);\n \t\t\tint retries = readahead_length / (5 * SHORT_SLEEP_US);\n \n-\t\t\ttst_res(TDEBUG, \"Per-file cached: %lu kB\", cached_cur / 1024);\n+\t\t\tretries = MAX(retries + 5, MIN_RETRY_LIMIT);\n \n \t\t\tdo {\n \t\t\t\tusleep(SHORT_SLEEP_US);\n+\t\t\t\tcache_diff = get_file_cached_bytes(fname,\n+\t\t\t\t\tfsize) - (ssize_t)cached_prev;\n \n-\t\t\t\tcached_prev = cached_cur;\n-\t\t\t\tcached_cur = get_file_cached_bytes(fname, fsize);\n-\n-\t\t\t\tif (cached_cur <= cached_prev)\n+\t\t\t\tif (cache_diff >= readahead_length / 2)\n \t\t\t\t\tbreak;\n \t\t\t} while (retries-- > 0);\n \n",
    "prefixes": [
        "v2"
    ]
}